@import url('tokens.css');
@import url('type.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
}

a { color: inherit; }

[hidden] {
  display: none !important;
}

.site-frame {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.site-band { width: 100%; }

.site-band + .site-band { padding-top: var(--space-block); }

.site-band--header {
  padding-top: 2rem;
  padding-bottom: 0;
}

.site-band--footer {
  border-top: 1px solid var(--rule);
  margin-top: var(--space-block);
  padding-top: var(--space-block);
  padding-bottom: var(--space-block);
}

.footer-copy {
  font-family: var(--sans);
  font-size: clamp(0.58rem, 0.85vw, 0.68rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.2;
  text-transform: lowercase;
  color: var(--ink-muted);
}

.section-inner { max-width: var(--content-max); }

.section-inner--header {
  max-width: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-name,
nav a,
.section-label {
  font-family: var(--sans);
  font-size: clamp(1.4rem, 3.5vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.12;
  text-transform: lowercase;
}

.site-name {
  color: var(--ink);
  text-decoration: none;
}

nav { display: flex; gap: 1.5rem; align-items: baseline; }

nav a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s;
}

nav a:hover,
nav a[aria-current="page"] { color: var(--ink); }

nav a[aria-current="page"] { border-bottom: 1px solid var(--ink); padding-bottom: 2px; }

.single-page nav a {
  padding: 0.4rem 0.55rem;
  margin: -0.4rem -0.55rem;
  transition: background 0.18s var(--ease-out), color 0.18s var(--ease-out);
}

.single-page nav a:hover,
.single-page nav a:focus-visible {
  background: var(--ink);
  color: var(--bg);
  border-bottom-color: transparent;
  padding-bottom: 0.4rem;
}

.single-page nav a[aria-current="page"] {
  border-bottom: none;
}

.section-label {
  color: var(--ink-soft);
  margin-bottom: clamp(0.75rem, 2vw, 1.25rem);
}

.enter-step.enter-pending {
  opacity: 0;
  transform: translateY(14px);
}

.enter-step.is-entered {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .enter-step.enter-pending {
    opacity: 1;
    transform: none;
  }

  .enter-step.is-entered { transition: none; }
}

/* Hero */
.hero.site-band {
  padding-top: var(--space-hero-top);
  padding-bottom: 0;
}

.hero-headline {
  font-family: var(--sans);
  font-size: clamp(1.5rem, 3.8vw, 2.5rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: none;
  width: 100%;
}

/* Single-page layout */
.single-page {
  overflow-x: hidden;
}

.single-page .site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}

.single-page .site-band + .site-band,
.single-page .site-header + .site-band {
  padding-top: var(--space-block);
}

.single-page .landing-section {
  min-height: calc(100svh - 4.5rem);
  display: flex;
  align-items: flex-start;
  padding-top: 0;
  padding-bottom: clamp(1.5rem, 6vh, 4rem);
}

.single-page .landing-inner {
  width: 100%;
}

.hero-text-slot {
  width: 100%;
}

.single-page .hero-headline.hero-headline--landing,
.single-page .type-title--hero.hero-headline--landing {
  font-size: clamp(2rem, 7.25vw, 8rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.04em;
  max-width: none;
}

@media (max-width: 600px) {
  .single-page .hero-headline.hero-headline--landing,
  .single-page .type-title--hero.hero-headline--landing {
    font-size: clamp(1.65rem, 8.5vw, 3rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
  }
}

.hero-controls {
  margin-top: clamp(1.25rem, 2.5vw, 2rem);
}

.single-page .hero-headline.hero-headline--landing {
  overflow: visible;
}

.hero-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  min-width: 2.65rem;
  min-height: 2.65rem;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hero-switch:disabled {
  cursor: wait;
}

.hero-switch:focus-visible {
  outline: none;
}

.hero-switch:focus-visible .hero-switch-track {
  box-shadow: 0 0 0 4px rgba(28, 27, 24, 0.2);
}

.hero-switch-track {
  position: relative;
  flex-shrink: 0;
  width: 3.25rem;
  height: 2rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--rule);
  transition: background 0.22s var(--ease-out), border-color 0.22s var(--ease-out);
}

.hero-switch[aria-checked="true"] .hero-switch-track {
  background: var(--ink);
  border-color: var(--ink);
}

.hero-switch-thumb {
  position: absolute;
  top: 0.1rem;
  left: 0.1rem;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: none;
  transition: transform 0.22s var(--ease-out);
}

.hero-switch[aria-checked="true"] .hero-switch-thumb {
  transform: translateX(1.5rem);
}

@media (min-width: 768px) {
  .hero-switch {
    padding: 0.55rem;
    min-width: 3.25rem;
    min-height: 3.25rem;
  }

  .hero-switch-track {
    width: 4.5rem;
    height: 2.75rem;
  }

  .hero-switch-thumb {
    top: 0.12rem;
    left: 0.12rem;
    width: 2.25rem;
    height: 2.25rem;
  }

  .hero-switch[aria-checked="true"] .hero-switch-thumb {
    transform: translateX(2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-switch-track,
  .hero-switch-thumb {
    transition: none;
  }
}

html[data-hero-font="newspaper"] .hero-word--f0 {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.02em;
}

html[data-hero-font="newspaper"] .hero-word--f1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-style: italic;
}

html[data-hero-font="newspaper"] .hero-word--f2 {
  font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
  font-weight: 400;
  letter-spacing: 0.02em;
}

html[data-hero-font="newspaper"] .hero-word--f3 {
  font-family: 'Courier Prime', 'Courier New', monospace;
  font-weight: 700;
}

html[data-hero-font="newspaper"] .hero-word--f4 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-weight: 400;
  font-style: italic;
}

html[data-hero-font="newspaper"] .hero-word--f5 {
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

html[data-hero-font="newspaper"] .hero-word--f6 {
  font-family: 'Special Elite', 'Courier New', monospace;
  font-weight: 400;
}

html[data-hero-font="newspaper"] .hero-word--f7 {
  font-family: 'Abril Fatface', Georgia, serif;
  font-weight: 400;
}

html[data-hero-font="newspaper"] .hero-word--f8 {
  font-family: 'UnifrakturMaguntia', 'Old English Text MT', serif;
  font-weight: 400;
}

html[data-hero-font="newspaper"] .hero-word--f9 {
  font-family: 'Permanent Marker', 'Comic Sans MS', cursive;
  font-weight: 400;
}

html[data-hero-font="newspaper"] .hero-word--f10 {
  font-family: 'Dancing Script', 'Brush Script MT', cursive;
  font-weight: 600;
}

.single-page .page-section {
  scroll-margin-top: 5rem;
}

.single-page .page-section .section-label:first-child {
  margin-top: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* About / Connect pages */
.connect-page .hero.site-band,
.work-page .portfolio-section { padding-top: clamp(2rem, 5vw, 3rem); }

/* Editorial index rows (connect, work) */
.index-list {
  list-style: none;
  border-top: 1px solid var(--rule);
}

.index-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem clamp(2rem, 6vw, 5rem);
  padding: clamp(1rem, 3vw, 1.35rem) clamp(0.75rem, 3vw, 1.75rem);
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  font-family: var(--sans);
  color: var(--ink);
  transition: background 0.18s var(--ease-out), color 0.18s var(--ease-out);
}

.index-row .type-title {
  color: currentColor;
  transition: color 0.18s var(--ease-out);
}

.index-row:hover,
.index-row:focus-visible {
  background: var(--ink);
  color: var(--bg);
}

.index-row:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}

.index-row-meta {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink-muted);
  text-align: right;
  white-space: nowrap;
  min-width: 5.5rem;
  padding-right: 0.35rem;
  transition: color 0.18s var(--ease-out);
}

.index-row:hover .index-row-meta,
.index-row:focus-visible .index-row-meta,
.index-row:hover .index-row-title,
.index-row:focus-visible .index-row-title,
.index-row:hover .type-title,
.index-row:focus-visible .type-title {
  color: var(--bg);
}

.about-flex {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about-photo {
  width: 100%;
  max-width: 20rem;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.about-text {
  font-family: var(--sans);
}

.about-text p {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 1.2em;
}

.about-text p:last-child { margin-bottom: 0; }

.about-text strong {
  font-weight: 600;
  color: var(--ink);
}

@media (min-width: 768px) {
  .about-flex {
    flex-direction: row;
    gap: 2.5rem;
    align-items: flex-start;
  }

  .about-photo-col { flex: 0 0 38%; max-width: 38%; }
  .about-text-col { flex: 1; min-width: 0; }
}

/* Portfolio gate */
.portfolio-section { padding-top: var(--space-block); }

.portfolio-wrap { position: relative; }

#portfolio-gate {
  position: relative;
  z-index: 2;
  max-width: 28rem;
  margin-bottom: 2rem;
}

#portfolio-gate.is-hidden { display: none; }

.gate-desc {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.gate-form {
  display: flex;
  border: 1px solid var(--rule);
  background: var(--bg);
}

.gate-form input[type="password"] {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink);
  outline: none;
}

.gate-form input::placeholder { color: var(--ink-muted); }

.gate-form button {
  background: var(--ink);
  border: none;
  padding: 0.75rem 1.25rem;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  cursor: pointer;
  transition: background 0.2s;
}

.gate-form button:hover { background: var(--clay); }

.gate-error {
  font-size: 0.7rem;
  color: var(--clay);
  margin-top: 0.75rem;
  display: none;
}

/* Work index */
.work-index-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 1rem 2rem;
  column-gap: clamp(1rem, 4vw, 2.5rem);
  padding-left: clamp(0.75rem, 3vw, 1.75rem);
  padding-right: clamp(0.75rem, 3vw, 1.75rem);
}

.work-row {
  grid-template-columns: 1fr auto auto;
  column-gap: clamp(1rem, 4vw, 2.5rem);
}

.work-index-head {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0;
}

.work-index-head-cell {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.work-index-head-cell--year,
.work-row-year {
  text-align: right;
  min-width: 3rem;
  font-variant-numeric: tabular-nums;
}

.work-index {
  list-style: none;
  border-top: 1px solid var(--rule);
}

.work-index-item {
  border-bottom: 1px solid var(--rule);
}

.work-row-year {
  min-width: 3rem;
  letter-spacing: 0.06em;
}

@media (prefers-reduced-motion: reduce) {
  .index-row,
  .single-page nav a {
    transition: none;
  }
}

@media (max-width: 520px) {
  .work-index-head {
    display: none;
  }

  .work-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .work-row .index-row-title {
    grid-column: 1 / -1;
  }

  .work-row .work-row-category {
    grid-column: 1;
  }

  .work-row .work-row-year {
    grid-column: 2;
    text-align: right;
  }
}

.site-main.is-ready { opacity: 1; }

@media (min-width: 900px) {
  .site-frame {
    padding-left: clamp(1.5rem, 4vw, 3rem);
    padding-right: clamp(1.5rem, 4vw, 3rem);
  }

}

@media (max-width: 600px) {
  nav { gap: 1rem; }
}
