:root {
  --paper: #fff8e7;
  --paper-deep: #f3ebd4;
  --ink: #1f1e1a;
  --muted: #5c584e;
  --line: rgba(31, 30, 26, 0.16);
  --palm: #0f3d3e;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --pad: clamp(1.25rem, 5vw, 4.5rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  color-scheme: light;
  background: #f1eee5;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100svh;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("../assets/palm.png");
  background-repeat: no-repeat;
  background-position: var(--palm-x, 50%) var(--palm-y, 50%);
  background-size: auto var(--palm-size, 92vh);
}

body[data-palm="nw-se"] {
  --palm-x: -50%;
  --palm-y: -36%;
  --palm-size: 68vh;
}

body[data-palm="ne-sw"] {
  --palm-x: 138%;
  --palm-y: -28%;
  --palm-size: 68vh;
}

body > main,
body > header,
body > footer {
  position: relative;
  z-index: 1;
}

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

a {
  color: inherit;
}

::selection {
  background: var(--palm);
  color: var(--paper);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 1px solid var(--palm);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  left: var(--pad);
  top: 0.75rem;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--ink);
  padding: 0.4rem 0.7rem;
  z-index: 5;
}

.skip:focus {
  transform: none;
}

.mast {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  min-height: 44px;
}

.legal .mast {
  position: relative;
  z-index: 2;
}

.legal .mast a {
  background: #f1eee5;
}

.eyebrow,
.mast a.home {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.langs {
  display: flex;
  gap: 0.9rem;
}

.langs a {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: rgba(31, 30, 26, 0.34);
}

.langs a[aria-current="page"],
body:has(#english:target) .langs a[href="#english"] {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--ink);
}

body:has(#english:target) .langs a[aria-current="page"] {
  color: rgba(31, 30, 26, 0.34);
  font-weight: 400;
  box-shadow: none;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(2rem, 8vh, 5rem);
  padding: 1.1rem var(--pad) clamp(1.5rem, 5vh, 3rem);
  overflow: clip;
}

.lockup {
  align-self: end;
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(12.5rem, 18rem);
  column-gap: clamp(1.5rem, 5vw, 5.5rem);
  align-items: end;
  position: relative;
  z-index: 1;
  will-change: transform;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.hero h1 {
  font-size: clamp(3.35rem, 8.6vw, 6.85rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.legal h1,
.page-404 h1 {
  font-size: clamp(3.1rem, 7vw, 5.8rem);
  line-height: 0.94;
  max-width: 14ch;
}

h1 span {
  display: block;
}

h1 span + span {
  margin-left: 0.16em;
}

.lede {
  margin: 0 0 0.55rem;
  max-width: 16rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.hero-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  will-change: transform;
}

.hero-note {
  margin: 0;
  max-width: 18rem;
  color: var(--muted);
  font-size: 0.98rem;
  text-wrap: pretty;
}

.hero-aside {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-align: right;
}

.hero-aside span {
  display: block;
}

.concept,
.portrait {
  padding: clamp(6rem, 16vh, 11rem) var(--pad);
}

.concept {
  display: block;
}

.concept-copy {
  max-width: 38rem;
  position: relative;
  z-index: 1;
  background-color: #f1eee5;
}

.concept-copy h2 {
  margin-bottom: 1.35rem;
}

.rule {
  width: 2.75rem;
  height: 1px;
  background: var(--palm);
  border: 0;
  margin: 0 0 1.35rem;
}

h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 4.6vw, 4.15rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.concept-copy p,
.portrait-copy p {
  margin: 0 0 1.15rem;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.concept-copy p:last-child,
.portrait-copy p:last-child {
  margin-bottom: 0;
  color: var(--ink);
}

.portrait {
  display: grid;
  grid-template-columns: minmax(14rem, 0.7fr) minmax(16rem, 0.9fr);
  gap: clamp(2.5rem, 8vw, 8rem);
  align-items: center;
}

.portrait-copy {
  max-width: 24rem;
}

.drift {
  min-width: 0;
}

.device-stage {
  justify-self: end;
  width: min(20.5rem, 78vw);
}

.device {
  margin: 0;
  will-change: transform;
}

.device-bezel {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 2.35rem;
  padding: 0.65rem;
}

.device-screen {
  position: relative;
  aspect-ratio: 472 / 1024;
  border-radius: 1.85rem;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(31, 30, 26, 0.08);
}

.device-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.device.has-shot .device-shot {
  opacity: 1;
}

.device.has-shot .device-poster {
  visibility: hidden;
}

.device-poster {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.55rem 1.25rem 1.35rem;
}

.device-poster .eyebrow {
  color: var(--palm);
}

.device-lines {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 3vw, 2.45rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.device-lines span {
  display: block;
}

.device-lines span:last-child {
  font-style: italic;
}

.device figcaption {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.js .reveal {
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}

.js .reveal.is-in {
  opacity: 1;
}

.colophon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem 2.5rem;
  align-items: end;
  margin-top: 2rem;
  padding: 1.5rem var(--pad) 2.5rem;
  border-top: 1px solid var(--line);
}

.colophon-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.colophon nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 1.6rem;
}

.colophon nav.colophon-en {
  display: none;
}

body:has(#english:target) .colophon nav.colophon-es {
  display: none;
}

body:has(#english:target) .colophon nav.colophon-en {
  display: flex;
}

.colophon a {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
}

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

.colophon-mail {
  grid-column: 1 / -1;
  color: var(--muted);
  width: max-content;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.legal {
  padding: 1.25rem var(--pad) 0;
}

.legal-title {
  max-width: 18ch;
  padding: clamp(4.5rem, 12vh, 8rem) 0 0;
}

.legal-title p {
  margin: 1.25rem 0 0;
  color: var(--muted);
}

.prose {
  max-width: 40rem;
  margin: clamp(3rem, 8vh, 5.5rem) var(--pad) clamp(5rem, 12vh, 8rem);
}

.prose + .prose {
  margin-top: 0;
  padding-top: clamp(3rem, 8vh, 5rem);
  border-top: 1px solid var(--line);
}

.prose h1 {
  font-size: clamp(3.1rem, 7vw, 5.4rem);
  line-height: 0.94;
  max-width: 12ch;
  margin-bottom: 1rem;
}

.prose h2 {
  margin: 2.6rem 0 0.85rem;
  font-size: clamp(1.7rem, 2.4vw, 2.15rem);
  letter-spacing: -0.03em;
}

.prose h2::before {
  content: counter(clause, decimal-leading-zero);
  counter-increment: clause;
  display: block;
  margin-bottom: 0.45rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.prose {
  counter-reset: clause;
}

.prose h3 {
  margin: 1.7rem 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.prose p,
.prose li {
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.65;
  text-wrap: pretty;
}

.prose ul {
  margin: 0.4rem 0 1rem;
  padding-left: 1.1rem;
}

.prose a {
  color: var(--palm);
}

.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.84em;
}

.prose a,
.prose code {
  overflow-wrap: anywhere;
}

.page-404 {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 1.1rem var(--pad) 0;
}

.page-404 main {
  align-self: end;
  padding-bottom: clamp(4rem, 12vh, 8rem);
}

.page-404 h1 {
  font-size: clamp(3.4rem, 8vw, 6.4rem);
  max-width: 12ch;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js .reveal.is-in {
    opacity: 1;
    transition: none;
  }

  .device-shot,
  .lockup,
  .hero-foot,
  .device {
    will-change: auto;
  }
}

@media (max-width: 800px) {
  :root {
    --palm-size: 72vh;
  }
}

@media (max-width: 860px) {
  .lockup,
  .concept,
  .portrait {
    grid-template-columns: 1fr;
  }

  .lede {
    margin: 0.4rem 0 0;
  }

  .device-stage {
    justify-self: start;
  }
}

@media (max-width: 700px) {
  .hero h1 {
    font-size: clamp(2.7rem, 12.5vw, 4.1rem);
  }

  .hero-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-aside {
    text-align: left;
  }

  .colophon,
  .colophon nav {
    grid-template-columns: 1fr;
    justify-content: flex-start;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 900px) {
  .prose {
    margin-left: min(16vw, 12rem);
    margin-right: var(--pad);
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .colophon a {
    background-size: 0 1px;
    transition: background-size 0.45s var(--ease);
  }

  .colophon a:hover,
  .colophon a:focus-visible {
    background-size: 100% 1px;
  }
}

@media print {
  .langs,
  .skip,
  body::before {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .hero {
    min-height: auto;
  }

  a {
    text-decoration: underline;
  }
}
