/* KTT Visuals
   Home: one screen. Text index on the left third, a full-height frame on the right
   that shows the hovered project's first photo.
   Project page: title, photos, a scrolling band, three next projects.
   An asterisk at top centre opens a black full-screen menu.
   Single look by design: white pages, black menu. */

@font-face { font-family: "Caslon"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/libre-caslon-text-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Caslon"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/libre-caslon-text-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Caslon"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/libre-caslon-text-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Caslon"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/libre-caslon-text-latin-ext-400-italic.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Hanken"; font-weight: 400; font-display: swap; src: url("fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken"; font-weight: 500; font-display: swap; src: url("fonts/hanken-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Pinyon"; font-weight: 400; font-display: swap; src: url("fonts/pinyon-script-latin-400-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #0b0b0c;
  --accent: #1f3bff;
  --muted: #7d7d84;
  --night: #000000;
  --on-night: #f6f6f3;

  --serif: "Caslon", "Baskerville", "Times New Roman", serif;
  --sans: "Hanken", "Helvetica Neue", Arial, sans-serif;
  --script: "Pinyon", "Snell Roundhand", cursive;

  /* serif that turns italic on hover */
  --list-font: var(--serif);
  --hover-font: var(--serif);
  --hover-style: italic;
  --hover-scale: 1;
  --title-scale: 1;
  --band-font: var(--serif);
  --band-style: italic;
  --band-weight: 400;

  --row: 1.9rem;
  --list-size: clamp(1rem, 0.6rem + 0.7vw, 1.2rem);
  --gutter: clamp(16px, 5vw, 100px);
}
:root[data-type="sans"] {
  /* sans that turns into a script on hover */
  --list-font: var(--sans);
  --hover-font: var(--script);
  --hover-style: normal;
  --hover-scale: 1.55;
  --title-scale: 1.3;
  --band-font: var(--sans);
  --band-style: normal;
  --band-weight: 500;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--list-font);
  font-size: var(--list-size);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.name { font-size: 1.625em; line-height: 1.3; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ================= home ================= */
html.is-home, html.is-home body { height: 100%; overflow: hidden; }
.home { height: 100%; display: grid; grid-template-columns: minmax(240px, max-content) 1fr; }
.index {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-inline: clamp(20px, 5vw, 130px) clamp(28px, 3vw, 56px);
  padding-block: 14px 16px;
  overflow: hidden;
}
.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.projects a {
  display: block;
  height: var(--row);
  line-height: var(--row);
  white-space: nowrap;
  transition: color 0.15s ease;
}
.projects a.is-active,
.menu nav a:hover,
.menu nav a:focus-visible {
  font-family: var(--hover-font);
  font-style: var(--hover-style);
  font-size: calc(1em * var(--hover-scale));
}
.projects a.is-active { color: var(--accent); }

.typeswitch {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}
.typeswitch button {
  font: inherit;
  letter-spacing: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.typeswitch button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

/* The whole photo, never cropped. It sits against the right edge: a portrait fills the
   height, a landscape stretches left toward the titles as far as it needs. */
.frame { position: relative; min-width: 0; overflow: hidden; background: var(--paper); }
.shot {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.shot.is-active { opacity: 1; }
.shot picture { display: contents; }
.shot img { width: 100%; height: 100%; object-fit: contain; object-position: right center; }

/* ================= project page ================= */
.project {
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 8vw, 110px);
  padding-inline: var(--gutter);
  padding-block: 14px 20px;
}
.head { display: grid; gap: 12px; max-width: 46rem; padding-top: clamp(40px, 8vw, 120px); }
.head h1 {
  margin: 0;
  font-family: var(--hover-font);
  font-style: var(--hover-style);
  font-weight: 400;
  font-size: calc(clamp(2rem, 1.2rem + 3vw, 3.6rem) * var(--title-scale));
  line-height: 1.1;
  text-wrap: balance;
}
.meta {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: var(--muted);
}

.frames { display: flex; flex-direction: column; gap: clamp(16px, 2.5vw, 32px); }
.row-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 32px); align-items: start; }
/* --r is the photo's width/height, set per image, so no photo is taller than the screen */
.frames img { background: #f1f1f1; height: auto; margin-inline: auto; }
.row-full img { width: min(100%, calc(92vh * var(--r))); }
.row-single img { width: min(100%, 760px, calc(92vh * var(--r))); }
.row-pair img { width: 100%; }
.row-wide img { width: 100%; }

.more { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 52px); }
.band { overflow: hidden; margin-inline: calc(-1 * var(--gutter)); }
.band-track {
  display: flex;
  width: max-content;
  animation: band 28s linear infinite;
}
.band-track span {
  padding-right: 0.35em;
  font-family: var(--band-font);
  font-style: var(--band-style);
  font-weight: var(--band-weight);
  font-size: clamp(3.2rem, 1rem + 8vw, 8rem);
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}
@keyframes band { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
}
.card { display: grid; gap: 14px; min-width: 0; }
.card img { width: 100%; height: auto; aspect-ratio: 2.15 / 1; object-fit: cover; background: #f1f1f1; transition: opacity 0.2s ease; }
.card-title {
  font-family: var(--hover-font);
  font-style: var(--hover-style);
  font-size: calc(0.95em * var(--hover-scale));
  line-height: 1.3;
  transition: color 0.15s ease;
}
.card:hover .card-title, .card:focus-visible .card-title { color: var(--accent); }
.card:hover img { opacity: 0.88; }

.foot {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ================= about ================= */
.about { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; gap: 40px; padding-inline: var(--gutter); padding-block: 14px 20px; }
.about-body { align-self: center; display: grid; gap: 28px; max-width: 38rem; }
.about-body p { margin: 0; font-size: clamp(1.15rem, 0.9rem + 0.8vw, 1.6rem); line-height: 1.45; text-wrap: pretty; }
.about-body h2 { margin: 0 0 6px; font-family: var(--sans); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.about-body ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.about-body a { border-bottom: 1px solid currentColor; }
.about-body a:hover { color: var(--accent); }
.about-grid {
  align-self: center;
  display: grid;
  gap: clamp(28px, 4vw, 48px);
  max-width: 38rem;
}
/* as wide as the text, but never taller than 75% of the window (the photo is 4:5) */
.about-photo { margin: 0; width: min(100%, calc(75vh * 0.8)); }
.about-photo img { width: 100%; height: auto; }

/* ================= contact ================= */
.contact { width: min(100%, 34rem); }
.contact-title { margin: 0; font-family: var(--hover-font); font-style: var(--hover-style); font-weight: 400;
  font-size: calc(clamp(2rem, 1.2rem + 3vw, 3.6rem) * var(--title-scale)); line-height: 1.1; }
.about-body .contact-lead { font-size: 1.05rem; }
.form { display: grid; gap: 6px; }
.form label { margin-top: 14px; font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.form input, .form textarea {
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 8px 0;
  width: 100%;
}
.form textarea { resize: vertical; min-height: 7.5em; }
.form input:focus, .form textarea:focus { outline: none; border-bottom-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }
.form [aria-invalid="true"] { border-bottom-color: #c0392b; }
.form button {
  justify-self: start;
  margin-top: 22px;
  font: inherit;
  font-size: 1.15rem;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.form button:hover, .form button:focus-visible { font-family: var(--hover-font); font-style: var(--hover-style); color: var(--accent); }
.form button[disabled] { opacity: 0.5; cursor: wait; }
.about-body .form-status { margin: 10px 0 0; min-height: 1.5em; font-family: var(--sans); font-size: 0.9rem; }
.form-status.is-ok { color: var(--ink); }
.form-status.is-error { color: #c0392b; }
.about-body .contact-alt { font-size: 0.95rem; color: var(--muted); }

/* ================= asterisk + menu ================= */
.star {
  position: fixed;
  z-index: 20;
  top: calc(env(safe-area-inset-top, 0px) + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--paper);
  mix-blend-mode: difference;
}
/* same height as the "ktt visuals" lettering (its 'k' is 0.83em tall; the asterisk fills 398/540 of this box) */
.star svg { display: block; fill: currentColor; width: calc(var(--list-size) * 1.625 * 1.126); height: auto; }
/* one full turn around its own centre on every click */
.star.spin svg { animation: star-spin 0.6s cubic-bezier(0.45, 0, 0.2, 1); }
@keyframes star-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.menu {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--night);
  color: var(--on-night);
  display: grid;
  place-items: center;
  padding: 80px 20px 20px;
  animation: menu-in 0.25s ease;
}
.menu[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; } to { opacity: 1; } }
.menu nav { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.menu nav a { height: 2.4rem; line-height: 2.4rem; font-size: 1.15em; white-space: nowrap; }
.menu nav a:hover, .menu nav a:focus-visible { font-size: calc(1.15em * var(--hover-scale)); }
.wordmark {
  position: absolute;
  left: clamp(20px, 3vw, 56px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  font-family: var(--hover-font);
  font-style: var(--hover-style);
  font-size: clamp(2.6rem, 6.5vw, 6.5rem);
  line-height: 0.95;
}

/* ================= phone ================= */
@media (max-width: 720px) {
  .home { grid-template-columns: 1fr; grid-template-rows: 52% 1fr; }
  .shot img { object-position: center; }
  .frame { order: -1; }
  .index { padding-inline: 20px; padding-block: 12px; }
  .projects { justify-content: flex-start; padding-block: 10px; }
  .menu nav a { font-size: 1.3em; }
  .cards { grid-template-columns: 1fr; }
  .row-pair { grid-template-columns: 1fr; }
  .row-full img, .row-single img { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .shot, .projects a, .card img, .card-title { transition: none; }
  .star.spin svg { animation: none; }
  .menu, .band-track { animation: none; }
}
