:root {
  --paper: #f3efe6;
  --paper-2: #ebe5d8;
  --ink: #17251f;
  --muted: #56665e;
  --rule: rgba(23, 37, 31, 0.075);
  --rule-strong: rgba(23, 37, 31, 0.18);
  --accent: #c98a1b;
  --leaf: #2f5d4a;
  --petal: #fffdf7;
  --petal-edge: rgba(23, 37, 31, 0.22);
  --shadow: 0 1px 0 rgba(23, 37, 31, 0.06), 0 18px 40px -24px rgba(23, 37, 31, 0.35);
  --display: "Young Serif", "Iowan Old Style", Georgia, serif;
  --body: "Hanken Grotesk", "Helvetica Neue", Helvetica, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --grid: 28px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1713;
    --paper-2: #16211b;
    --ink: #ece6d8;
    --muted: #9aa9a1;
    --rule: rgba(236, 230, 216, 0.06);
    --rule-strong: rgba(236, 230, 216, 0.16);
    --accent: #e3a93a;
    --leaf: #86bba1;
    --petal: #f1ece0;
    --petal-edge: rgba(15, 23, 19, 0.5);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 18px 40px -24px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: var(--grid) var(--grid);
  background-position: -1px -1px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* margin line, like a notebook page */
body::before {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: max(16px, calc(50% - 600px));
  width: 1px;
  background: var(--accent);
  opacity: 0.35;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--leaf);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

/* ---------- header ---------- */

.site-header {
  padding: 22px 0;
  border-bottom: 1px solid var(--rule-strong);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: -0.01em;
}

.brand svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.nav {
  display: flex;
  gap: clamp(14px, 3vw, 28px);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
}

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

.nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ---------- labels ---------- */

.label {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.label::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
}

/* ---------- hero ---------- */

.hero {
  padding: clamp(56px, 10vw, 120px) 0 clamp(48px, 8vw, 96px);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 22px 0 26px;
  position: relative;
  z-index: 0;
}

.hero h1 em {
  font-style: normal;
  color: var(--leaf);
  position: relative;
  white-space: nowrap;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.06em;
  height: 0.16em;
  background: var(--accent);
  opacity: 0.35;
  border-radius: 2px;
  z-index: -1;
}

.lede {
  font-size: clamp(18px, 2vw, 21px);
  color: var(--muted);
  max-width: 34em;
  margin: 0;
}

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

.specimen {
  position: relative;
  aspect-ratio: 1;
  max-width: 420px;
  width: 100%;
  justify-self: center;
}

.specimen-card {
  position: absolute;
  inset: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 28px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
  transform: rotate(-3deg);
}

.specimen svg {
  position: absolute;
  inset: 9%;
  width: 82%;
  height: 82%;
  animation: bloom 1.4s cubic-bezier(0.2, 0.7, 0.1, 1) both, sway 18s ease-in-out 1.4s infinite;
  transform-origin: 50% 50%;
}

.specimen .tag {
  position: absolute;
  right: -6px;
  bottom: 22px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  padding: 7px 11px;
  border-radius: 6px;
  transform: rotate(2deg);
}

.specimen .tag i {
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--display);
}

/* ---------- sections ---------- */

section + section {
  border-top: 1px solid var(--rule-strong);
}

.section {
  padding: clamp(56px, 8vw, 96px) 0;
}

.section h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 16px 0 40px;
  max-width: 18em;
}

.entries {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--ink);
}

.entry {
  padding: 26px 24px 30px 0;
  border-right: 1px solid var(--rule-strong);
}

.entry + .entry {
  padding-left: 24px;
}

.entry:last-child {
  border-right: 0;
}

.entry .num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.entry h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  margin: 10px 0 10px;
}

.entry p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

/* ---------- company card ---------- */

.company {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.company p {
  color: var(--muted);
  max-width: 28em;
}

.card {
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card dl {
  margin: 0;
}

.card .row {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px dashed var(--rule-strong);
}

.card .row:last-child {
  border-bottom: 0;
}

.card dt {
  font-family: var(--mono);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-top: 3px;
}

.card dd {
  margin: 0;
  font-size: 17px;
  overflow-wrap: anywhere;
}

/* ---------- legal pages ---------- */

.doc {
  padding: clamp(48px, 8vw, 96px) 0;
}

.doc .wrap {
  max-width: 820px;
}

.doc h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 18px 0 8px;
}

.doc .meta {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 40px;
}

.doc h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 25px;
  margin: 40px 0 10px;
}

.doc p,
.doc li {
  color: var(--ink);
  max-width: 40em;
}

.doc ul {
  padding-left: 1.2em;
}

.doc li + li {
  margin-top: 6px;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--ink);
  padding: 28px 0 36px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
}

.site-footer nav {
  display: flex;
  gap: 20px;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

/* ---------- motion ---------- */

.rise {
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.1, 1) both;
}

.d1 { animation-delay: 0.08s; }
.d2 { animation-delay: 0.18s; }
.d3 { animation-delay: 0.3s; }
.d4 { animation-delay: 0.42s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bloom {
  from {
    opacity: 0;
    transform: scale(0.82) rotate(-24deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(9deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rise,
  .specimen svg {
    animation: none;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero .wrap,
  .company {
    grid-template-columns: minmax(0, 1fr);
  }

  .specimen {
    max-width: 300px;
    justify-self: start;
  }

  .entries {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .entry:nth-child(2) {
    border-right: 0;
  }

  .entry:nth-child(3) {
    padding-left: 0;
  }

  .entry:nth-child(n + 3) {
    border-top: 1px solid var(--rule-strong);
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  body::before {
    display: none;
  }

  .entries {
    grid-template-columns: minmax(0, 1fr);
  }

  .entry,
  .entry + .entry {
    padding: 22px 0 24px;
    border-right: 0;
  }

  .entry + .entry {
    border-top: 1px solid var(--rule-strong);
  }

  .card .row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 14px 18px;
  }

  .nav {
    font-size: 12px;
  }
}
