/* ============================================
   Tokens
   ============================================ */
:root {
  --c-white: #ffffff;
  --c-ink: #0a0a0a;
  --c-graphite: #1a1a1a;
  --c-charcoal: #3a3a3a;
  --c-stone: #6b6b6b;
  --c-ash: #9a9a9a;
  --c-mist: #c8c8c8;
  --c-fog: #e6e6e6;
  --c-canvas: #fafafa;
  --c-whisper: #f4f4f4;

  --f-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --max-w: 1440px;
  --pad-x: clamp(1.5rem, 5vw, 5rem);

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-sans);
  background: var(--c-white);
  color: var(--c-graphite);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern', 'liga', 'calt';
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--c-ink);
  color: var(--c-white);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

/* --- Text area: left 50% of viewport, fixed-size text-block scales to fit --- */

.hero-text-area {
  position: absolute;
  left: 0;
  top: 0;
  width: 50vw;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* Fixed-aspect text block. Whole block has fixed size + fixed fonts.
   Stays at natural size on large viewports; only scales DOWN when the
   50vw × 100vh area minus 10% margins can't fit it (object-fit:contain).
   flex-shrink: 0 is critical — without it the flex parent shrinks the layout
   width below 480px when 50vw < 480px and the inner text re-wraps. */
.text-block {
  flex-shrink: 0;
  width: 480px;
  height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  transform-origin: center center;
  transform: scale(min(
    calc((50vw * 0.8) / 480px),
    calc((100vh * 0.8) / 620px)
  ));
}

.hero-name {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 4.5rem;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--c-ink);
}

.hero-name-line {
  display: block;
}

.hero-name-line:last-child {
  font-weight: 300;
  color: var(--c-graphite);
  padding-left: 0.5em;
}

.hero-subtitle {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-stone);
}

.hero-subtitle::before {
  content: '';
  width: 2.5rem;
  height: 1px;
  background: var(--c-mist);
}

.hero-bio {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--c-charcoal);
  line-height: 1.65;
}

.hero-bio p {
  text-wrap: pretty;
}

.bio-aside {
  color: var(--c-stone);
  font-family: var(--f-mono);
  font-size: 0.85em;
  letter-spacing: 0.01em;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  align-self: flex-start;
  padding: 1rem 1.75rem;
  background: var(--c-ink);
  color: var(--c-white);
  border: 1px solid var(--c-ink);
  font-family: var(--f-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.45s var(--ease-out),
    color 0.45s var(--ease-out);
}

.hero-cta:hover,
.hero-cta:focus-visible {
  background: var(--c-white);
  color: var(--c-ink);
  outline: none;
}

.hero-cta-arrow {
  display: inline-block;
  font-size: 1rem;
  transition: transform 0.45s var(--ease-out);
}

.hero-cta:hover .hero-cta-arrow,
.hero-cta:focus-visible .hero-cta-arrow {
  transform: translateY(4px);
}

/* --- Photo area: right 50% of viewport. Image stays at full vh, centered on
       the area's vertical axis. Edges are allowed to spill — left into text
       (white shoulder is fine), right gets clipped by .hero overflow. --- */

.hero-photo {
  position: absolute;
  right: 0;
  top: 0;
  width: 50vw;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
  /* overflow visible so the photo can bleed past the area when narrow */
}

.hero-photo img {
  height: 100vh;
  height: 100svh;
  width: auto;
  /* override the global `img { max-width: 100% }` reset — otherwise the
     image gets capped to the 60vw container and, with height pinned to
     100vh, its aspect ratio breaks (looks like a tall thin straw). */
  max-width: none;
  display: block;
  flex-shrink: 0;
  user-select: none;
}

/* ============================================
   Works
   ============================================ */
.works {
  position: relative;
  padding-top: clamp(5rem, 10vh, 8rem);
  padding-bottom: clamp(3rem, 6vh, 5rem);
  background: var(--c-white);
}

/* Soft drop-shadow that reads like the hero block is casting a shadow onto
   the works section. Concentrated at the very top, fades out within ~70px. */
.works::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: linear-gradient(
    to bottom,
    rgba(15, 15, 15, 0.10) 0%,
    rgba(15, 15, 15, 0.04) 35%,
    rgba(15, 15, 15, 0) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.works-header {
  margin: 0 var(--pad-x) clamp(3rem, 6vh, 5rem);
  padding-bottom: clamp(1.5rem, 3vh, 2.5rem);
  border-bottom: 1px solid var(--c-fog);
  display: flex;
  align-items: baseline;
  gap: 2rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.works-eyebrow {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-stone);
}

.works-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--c-ink);
}

.card {
  margin: 0 var(--pad-x);
  padding: clamp(3rem, 6vh, 5rem) 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  border-bottom: 1px solid var(--c-fog);
  /* Card is at least 50vh tall — short cards lock to 50vh, long ones grow
     to fit text. Image is independently capped at 50vh via .card-image. */
  min-height: 50vh;
  min-height: 50svh;
}

.card:last-of-type {
  border-bottom: none;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 32rem;
}

.card-num {
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--c-stone);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.85rem, 3.4vw, 2.85rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--c-ink);
  text-wrap: balance;
  margin-bottom: 0.25rem;
}

.card-desc {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.card-desc p {
  color: var(--c-charcoal);
  font-size: 0.975rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.card-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid;
  transition:
    background 0.4s var(--ease-out),
    color 0.4s var(--ease-out),
    border-color 0.4s var(--ease-out);
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: var(--c-ink);
  color: var(--c-white);
  border-color: var(--c-ink);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--c-white);
  color: var(--c-ink);
  outline: none;
}

.btn-arrow {
  display: inline-block;
  font-size: 0.95rem;
  transition: transform 0.4s var(--ease-out);
}

.btn-primary:hover .btn-arrow,
.btn-primary:focus-visible .btn-arrow {
  transform: translate(2px, -2px);
}

.btn-secondary {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-mist);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--c-ink);
  color: var(--c-white);
  border-color: var(--c-ink);
  outline: none;
}

.btn-secondary:hover .btn-arrow,
.btn-secondary:focus-visible .btn-arrow {
  transform: translate(2px, -2px);
}

.card-image {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  /* explicit height (not max-height) so the img's height: 100% resolves.
     50vh minus the card's vertical padding == image area inside one
     50vh-tall card. */
  height: calc(50vh - 2 * clamp(3rem, 6vh, 5rem));
  height: calc(50svh - 2 * clamp(3rem, 6vh, 5rem));
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* anchor visible content to the right so the artwork stays pinned to the
     viewport edge on very wide aspect ratios instead of floating in the
     middle of an oversized column */
  object-position: right center;
  transition: transform 0.8s var(--ease-out);
}

.card:hover .card-image img {
  transform: scale(1.02);
}

/* ============================================
   Footer
   ============================================ */
.page-footer {
  margin: 0 var(--pad-x);
  padding: 2.5rem 0;
  border-top: 1px solid var(--c-fog);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--c-stone);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-footer-aside {
  color: var(--c-graphite);
}

/* ============================================
   Reveal animation
   ============================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ============================================
   Responsive
   ============================================ */

/* --- Responsive (cards section only — hero is fully self-scaling) --- */

@media (max-width: 1199px) {
  .card {
    grid-template-columns: 1fr;
    gap: clamp(2rem, 5vh, 3rem);
    /* drop the fixed card height in stacked mode — image and text take
       their natural sizes vertically */
    height: auto;
    overflow: visible;
  }

  .card-image {
    order: -1;
    height: auto;
  }

  .card-image img {
    max-height: 50vh;
    height: auto;
    object-position: center center;
  }

  .card-body {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .card {
    padding: clamp(2.5rem, 5vh, 4rem) var(--pad-x);
  }

  .card-title {
    font-size: clamp(1.65rem, 6.5vw, 2.25rem);
  }

  .page-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .card-actions {
    width: 100%;
  }

  .card-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 0.65rem;
    padding: 0.85rem 1rem;
    letter-spacing: 0.12em;
  }
}
