/* HOME: big wordmark, motto, work grid, index list, closing line. */

/* ---------- Big wordmark ---------- */
.hero { padding: 2rem 0 var(--space); position: relative; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--red);
  /* Fluid size: always fits, even on an iPhone SE (320px wide). */
  font-size: clamp(4.5rem, 24vw, 15rem);
  line-height: 0.86;
  letter-spacing: -0.035em;
}
.wordmark span { display: block; }
.wordmark.grain { width: fit-content; max-width: 100%; }
.wordmark-italic { font-style: italic; }

/* Optional soft glow on the live-text wordmark. Remove this block for a flat look. */
.wordmark-text { text-shadow: 0 0 0.35em color-mix(in srgb, var(--red) 28%, transparent); }

/* Film grain: a tiny tiled texture laid over the wordmark. Works in light and dark. */
.grain { position: relative; isolation: isolate; }
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.35;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .grain::after { mix-blend-mode: screen; opacity: 0.18; } }
:root[data-theme="dark"] .grain::after { mix-blend-mode: screen; opacity: 0.18; }
@media (prefers-reduced-motion: no-preference) {
  .grain::after { animation: grain-shift 0.9s steps(4) infinite; }
}
@keyframes grain-shift {
  0%   { background-position: 0 0; }
  25%  { background-position: -40px 20px; }
  50%  { background-position: 30px -30px; }
  75%  { background-position: -20px -40px; }
  100% { background-position: 0 0; }
}

/* Exported wordmark loop (used when wordmark_video is true in _config.yml). */
.wordmark-media { position: relative; aspect-ratio: 16 / 7; background: var(--block); }
.wordmark-media video, .wordmark-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wordmark-media .media-item { opacity: 1; }
.wordmark-media .wordmark-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wordmark-media .wordmark-light { display: none; }
  :root:not([data-theme="light"]) .wordmark-media .wordmark-dark { display: block; }
}
:root[data-theme="dark"] .wordmark-media .wordmark-light { display: none; }
:root[data-theme="dark"] .wordmark-media .wordmark-dark { display: block; }
:root[data-theme="light"] .wordmark-media .wordmark-light { display: block; }
:root[data-theme="light"] .wordmark-media .wordmark-dark { display: none; }

/* ---------- Motto ---------- */
.motto {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.5vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 22ch;
  margin-top: 2rem;
}
.motto em { color: var(--red); }

/* ---------- Work grid ----------
   Two columns on phones, three on larger screens. Items flow down each column,
   which keeps mixed 9:16 and 16:9 pieces together with no cropping. */
.work-grid { column-count: 2; column-gap: 1rem; padding-bottom: var(--space); scroll-margin-top: 1rem; }
@media (min-width: 64rem) { .work-grid { column-count: 3; column-gap: 1.5rem; } }

/* ---------- Index list ---------- */
.work-index { padding-bottom: var(--space); }
.index-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1rem;
  align-items: baseline;
  padding: 0.7rem 0;
  border-top: 1px solid var(--ink);
  text-decoration: none;
  color: inherit;
}
.index-row:last-child { border-bottom: 1px solid var(--ink); }
.index-head {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-top: 0;
  padding-top: 0;
}
.index-project { font-family: var(--font-ui); font-weight: 500; font-size: 1rem; }
.index-role, .index-year { font-size: 0.8125rem; }
.index-role { grid-row: 2; }
.index-year { grid-row: 1; grid-column: 2; }
.index-head span:nth-child(2) { display: none; }
a.index-row:hover .index-project { color: var(--red-deep); }
@media (min-width: 48rem) {
  .index-row { grid-template-columns: 2fr 1.5fr 5rem; }
  .index-role { grid-row: auto; }
  .index-year { grid-row: auto; grid-column: auto; text-align: right; }
  .index-head span:nth-child(2) { display: inline; }
  .index-head span:nth-child(3) { text-align: right; }
}

/* ---------- Closing line ---------- */
.closing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-bottom: var(--space);
}
.closing-line {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--red);
  font-size: clamp(1.75rem, 5vw, 3.25rem);
  line-height: 1.05;
}
