/* ==========================================================================
   yakcraft design system
   Concept: high-altitude survey. Cold clear light, structural type,
   hairline cartography, one warm accent.
   ========================================================================== */

:root {
  /* Color — light ("thin air") */
  --ground: #e8ecee;
  --ink: #14181a;
  --slate: #545f65;
  --hairline: #c9d1d4;
  --topo: #94a5ad;
  --lapis: #1e3e7e;
  --marigold: #b4700f;

  /* Type */
  --display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Scale */
  --fs-display: clamp(2.6rem, 6vw, 4.5rem);
  --fs-h2: clamp(1.45rem, 2.4vw, 1.8rem);
  --fs-h3: 1.02rem;
  --fs-lede: clamp(1.05rem, 1.4vw, 1.2rem);
  --fs-label: 0.76rem;

  /* Measure */
  --wrap: 780px;
  --wrap-wide: 990px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0f1315;
    --ink: #e4e9ea;
    --slate: #8b969c;
    --hairline: #242c2f;
    --topo: #4a6069;
    --lapis: #8fb2f0;
    --marigold: #dfa355;
  }
}

/* --- Reset ---------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.06;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

svg {
  display: block;
}

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

/* --- Primitives ----------------------------------------------------------- */

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap-wide {
  max-width: var(--wrap-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Utility label — section names, metadata, eyebrows */
.label {
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
  line-height: 1.4;
}

/* Drafting-sheet section marker: label sitting on a hairline that runs out */
.rule {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 2.75rem;
}

.rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.band {
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

/* --- Logomark ------------------------------------------------------------- */

.mark {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--ink);
}

/* --- Nav ------------------------------------------------------------------ */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-link {
  font-size: 0.95rem;
  color: var(--slate);
  text-decoration: none;
  transition: color 0.16s ease;
}

.nav-link:hover {
  color: var(--ink);
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
  padding-top: clamp(3.5rem, 10vw, 6.5rem);
  padding-bottom: clamp(0.5rem, 2vw, 1rem);
}

.hero h1 {
  margin-top: 1.4rem;
  font-size: var(--fs-display);
}

.hero-lede {
  margin-top: 1.6rem;
  max-width: 33rem;
  font-size: var(--fs-lede);
  color: var(--slate);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 2.1rem;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--lapis);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.16s ease, gap 0.16s ease;
}

.cta:hover {
  border-bottom-color: var(--lapis);
  gap: 0.75rem;
}

.cta span {
  transition: transform 0.16s ease;
}

/* --- Signature: topographic survey ---------------------------------------- */

.topo {
  color: var(--topo);
  padding-bottom: clamp(0.5rem, 2vw, 1.25rem);
}

.topo svg {
  width: 100%;
  height: auto;
}

/* Narrow screens: crop into the survey rather than shrinking it to nothing */
@media (max-width: 660px) {
  .topo svg {
    height: 170px;
  }
}

.topo-lines path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 2.4s cubic-bezier(0.33, 0, 0.2, 1) forwards;
}

.topo-lines path:nth-child(1) { opacity: 0.58; animation-delay: 0.05s; }
.topo-lines path:nth-child(2) { opacity: 0.65; animation-delay: 0.14s; }
.topo-lines path:nth-child(3) { opacity: 0.72; animation-delay: 0.23s; }
.topo-lines path:nth-child(4) { opacity: 0.79; animation-delay: 0.32s; }
.topo-lines path:nth-child(5) { opacity: 0.86; animation-delay: 0.41s; }
.topo-lines path:nth-child(6) { opacity: 0.93; animation-delay: 0.5s; }
.topo-lines path:nth-child(7) { opacity: 1; animation-delay: 0.59s; }

.topo-summit {
  opacity: 0;
  animation: fade 0.8s ease 1.5s forwards;
}

/* --- Services ------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 2.25rem;
}

.grid h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.55rem;
}

.grid p {
  color: var(--slate);
  font-size: 0.96rem;
}

@media (max-width: 660px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* --- Prose ---------------------------------------------------------------- */

.prose {
  max-width: 36rem;
  font-size: var(--fs-lede);
}

/* --- Contact -------------------------------------------------------------- */

.contact h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
}

.contact p {
  margin-top: 1rem;
  max-width: 31rem;
  color: var(--slate);
}

.email {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  letter-spacing: -0.02em;
  text-decoration: none;
  border-bottom: 2px solid var(--marigold);
  padding-bottom: 2px;
  transition: color 0.16s ease;
}

.email:hover {
  color: var(--marigold);
}

/* --- Footer --------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--hairline);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  padding-block: 1.6rem 2.4rem;
}

/* --- Document pages (privacy, terms) -------------------------------------- */

.doc {
  padding-block: clamp(2.5rem, 6vw, 3.75rem) 5rem;
}

.doc-back {
  display: inline-block;
  margin-bottom: 2.25rem;
  text-decoration: none;
  transition: color 0.16s ease;
}

.doc-back:hover {
  color: var(--ink);
}

.doc-head {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 2.5rem;
}

.doc-head .label {
  display: block;
}

.doc-head h1 {
  margin-block: 0.75rem;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
}

.doc h2 {
  font-size: 1.14rem;
  letter-spacing: -0.012em;
  margin-top: 2.6rem;
  margin-bottom: 0.8rem;
}

.doc p,
.doc li {
  margin-bottom: 0.9rem;
  max-width: 34rem;
}

.doc ul {
  padding-left: 1.15rem;
}

.doc li::marker {
  color: var(--slate);
}

.doc a {
  color: var(--lapis);
  text-underline-offset: 2px;
}

/* Summary block. Hairlines rather than a filled card — the doc pages have no
   other boxed surfaces, and adding one would introduce a second idiom. */
.doc-note {
  margin: 2.25rem 0;
  padding: 1.4rem 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.doc-note .label {
  display: block;
  margin-bottom: 0.6rem;
}

.doc-note p:last-child {
  margin-bottom: 0;
}

/* Data table */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2.25rem;
  font-size: 0.95rem;
}

.doc-table th {
  text-align: left;
  padding: 0 1.25rem 0.65rem 0;
  border-bottom: 1px solid var(--hairline);
}

.doc-table td {
  padding: 0.9rem 1.25rem 0.9rem 0;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

.doc-table th:last-child,
.doc-table td:last-child {
  padding-right: 0;
}

/* Below the breakpoint a three-column table stops being readable, so each row
   becomes a stacked block and the column headers move inline via data-label. */
@media (max-width: 620px) {
  .doc-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .doc-table tr {
    display: block;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--hairline);
  }

  .doc-table tr:last-child {
    border-bottom: none;
  }

  .doc-table td {
    display: block;
    border: none;
    padding: 0;
  }

  .doc-table td + td {
    margin-top: 0.7rem;
  }

  .doc-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.1rem;
    font-size: var(--fs-label);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--slate);
  }
}

/* Trailing disclaimer / attribution */
.doc-footnote {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  color: var(--slate);
  font-size: 0.9rem;
}

/* --- Motion --------------------------------------------------------------- */

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

@keyframes fade {
  to { opacity: 1; }
}

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

.rise {
  opacity: 0;
  animation: rise 0.75s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.rise:nth-child(1) { animation-delay: 0.05s; }
.rise:nth-child(2) { animation-delay: 0.15s; }
.rise:nth-child(3) { animation-delay: 0.25s; }
.rise:nth-child(4) { animation-delay: 0.35s; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .rise,
  .topo-summit {
    opacity: 1;
  }
  .topo-lines path {
    stroke-dashoffset: 0;
  }
}
