:root {
  --bg: #fbfaf7;
  --ink: #171717;
  --muted: #77736d;
  --line: #e2ded6;
  --soft: #f1eee8;
  --pad: clamp(1rem, 3vw, 2rem);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

a:hover {
  border-bottom-color: currentColor;
}

button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  width: 100%;
}

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: calc(0.9rem + env(safe-area-inset-top)) var(--pad) 0.9rem;
  background: rgba(251, 250, 247, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.name {
  font-size: 0.95rem;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Main shell */

.page-shell {
  padding-top: calc(3.5rem + env(safe-area-inset-top));
}

.intro-panel {
  min-height: 56vh;
  display: grid;
  align-content: end;
  gap: 1.05rem;
  padding: clamp(4rem, 9vw, 9rem) var(--pad) clamp(2rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
}

.kicker,
.section-label,
.work-header,
.carousel-meta,
.project-index,
.site-footer {
  color: var(--muted);
  font-size: 0.86rem;
}

.kicker,
.section-label {
  margin: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 0;
  font-size: clamp(3.1rem, 9vw, 8.6rem);
  line-height: 0.92;
  letter-spacing: -0.075em;
  font-weight: 400;
}

.intro-panel > p:not(.kicker) {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.45vw, 1.25rem);
}

.intro-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  color: var(--muted);
}

.intro-links a,
.contact a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* Work */

.work-panel {
  padding: var(--pad);
  border-bottom: 1px solid var(--line);
}

.work-header {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 0.9rem;
}

.work-header p {
  margin-bottom: 0;
}

.mobile-hint {
  display: none;
}

.carousel {
  display: grid;
  gap: 0.85rem;
}

.image-button {
  width: 100%;
  min-height: 72vh;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--soft);
  cursor: pointer;
  touch-action: manipulation;
}

.image-button img {
  width: 100%;
  height: 72vh;
  object-fit: contain;
  background: var(--soft);
}

.carousel-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

.carousel-meta h2 {
  margin-bottom: 0.2rem;
  color: var(--ink);
  font-size: clamp(1.15rem, 1.8vw, 1.8rem);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.carousel-meta p {
  margin-bottom: 0;
}

.controls {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.controls button,
.project-index button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
}

.controls button {
  min-height: 44px;
  padding: 0 0.35rem;
}

.controls button:hover,
.project-index button:hover,
.project-index button.active {
  color: var(--ink);
}

.project-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.project-index button {
  min-height: 36px;
}

/* Text sections */

.text-section {
  display: grid;
  grid-template-columns: 0.35fr 1fr;
  gap: clamp(2rem, 8vw, 8rem);
  padding: clamp(3rem, 8vw, 7rem) var(--pad);
  border-bottom: 1px solid var(--line);
}

.large-text {
  max-width: 960px;
  margin-bottom: 0;
  font-size: clamp(1.45rem, 3.2vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.text-section p:not(.section-label) {
  color: var(--muted);
}

.contact p:not(.section-label) {
  font-size: clamp(1.3rem, 3vw, 2.7rem);
  line-height: 1.2;
  letter-spacing: -0.045em;
}

/* Footer */

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem var(--pad) calc(1rem + env(safe-area-inset-bottom));
}

/* iPhone / small screen optimisation */

@media (max-width: 760px) {
  :root {
    --pad: 1rem;
  }

  .site-header {
    position: sticky;
    display: block;
  }

  .name {
    display: block;
    margin-bottom: 0.7rem;
  }

  .nav {
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.88rem;
  }

  .nav a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
  }

  .page-shell {
    padding-top: 0;
  }

  .intro-panel {
    min-height: 62vh;
    padding-top: 4.5rem;
    padding-bottom: 2rem;
  }

  h1 {
    max-width: 12ch;
    font-size: clamp(3.1rem, 17vw, 5.2rem);
    line-height: 0.9;
    letter-spacing: -0.08em;
  }

  .intro-panel > p:not(.kicker) {
    font-size: 1rem;
    max-width: 30ch;
  }

  .intro-links {
    gap: 0.35rem 1rem;
  }

  .desktop-hint {
    display: none;
  }

  .mobile-hint {
    display: block;
  }

  .work-panel {
    padding-top: 1rem;
  }

  .work-header {
    margin-bottom: 0.7rem;
  }

  .image-button,
  .image-button img {
    min-height: 54vh;
    height: 54vh;
  }

  .carousel-meta {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .carousel-meta h2 {
    font-size: 1.35rem;
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.75rem;
    width: 100%;
  }

  .controls span {
    align-self: center;
  }

  .controls button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 0.8rem;
  }

  .project-index {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 1rem;
  }

  .project-index button {
    min-height: 44px;
    text-align: left;
    border-bottom: 1px solid var(--line);
  }

  .text-section {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .large-text {
    font-size: clamp(1.65rem, 8vw, 2.4rem);
    line-height: 1.08;
  }

  .contact p:not(.section-label) {
    font-size: clamp(1.4rem, 7vw, 2rem);
    line-height: 1.25;
  }

  .site-footer {
    font-size: 0.82rem;
  }
}

@media (max-width: 390px) {
  .image-button,
  .image-button img {
    min-height: 50vh;
    height: 50vh;
  }

  h1 {
    font-size: clamp(2.8rem, 16vw, 4.6rem);
  }

  .large-text {
    font-size: 1.55rem;
  }
}
