/* ---------------------------------------------------------------
   getmentat.com — Mentat Works OÜ
   Visual direction: a survey plan sheet. Structured judgment
   drawn onto terrain, which is what both products actually do.
   --------------------------------------------------------------- */

:root {
  --ground:   #101310;
  --surface:  #161A16;
  --raise:    #1D221D;
  --edge:     #2B322B;
  --edge-hi:  #3D463C;

  --ink:      #E6E9E1;
  --muted:    #949C8F;
  --dim:      #6C7468;

  --brass:    #C8A24A;
  --zone-a:   #5C8A69;
  --zone-b:   #A8873F;

  --measure:  74ch;
  --gutter:   clamp(1.25rem, 5vw, 4.5rem);
  --rhythm:   clamp(4rem, 9vw, 8rem);
}

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

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

body {
  margin: 0;
  background-color: var(--ground);
  /* the sheet: a fine coordinate grid across the whole page */
  background-image:
    linear-gradient(to right, rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 34px 34px;
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, sans-serif;
  font-variation-settings: "wdth" 100, "wght" 400;
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.62;
  letter-spacing: .002em;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* --- type roles ------------------------------------------------ */

.display {
  font-variation-settings: "wdth" 118, "wght" 680;
  font-size: clamp(2.1rem, 1.1rem + 4.4vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.022em;
  margin: 0;
  text-wrap: balance;
}

.lede {
  font-size: clamp(1.06rem, 1rem + .45vw, 1.35rem);
  line-height: 1.52;
  color: var(--muted);
  max-width: 52ch;
  margin: 1.4rem 0 0;
  text-wrap: pretty;
}

.mark {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--dim);
}

.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

h2 {
  font-variation-settings: "wdth" 112, "wght" 640;
  font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -.016em;
  margin: 0;
}

h3 {
  font-variation-settings: "wdth" 106, "wght" 620;
  font-size: 1.0625rem;
  line-height: 1.32;
  letter-spacing: -.004em;
  margin: 0 0 .55rem;
}

p { margin: 0 0 1.05rem; max-width: var(--measure); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

a:focus-visible,
.zone:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 1px;
}

/* --- shell ----------------------------------------------------- */

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

/* tick rule — a ruler edge, not a hairline */
.rule {
  height: 9px;
  border-top: 1px solid var(--edge);
  background-image: linear-gradient(to right, var(--edge) 1px, transparent 1px);
  background-size: 17px 5px;
  background-repeat: repeat-x;
}

/* --- masthead -------------------------------------------------- */

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

.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 58px;
}

.wordmark {
  font-variation-settings: "wdth" 122, "wght" 700;
  font-size: .9375rem;
  letter-spacing: .012em;
  text-decoration: none;
}
.wordmark span { color: var(--dim); font-variation-settings: "wdth" 122, "wght" 500; }

.masthead nav {
  display: flex;
  gap: clamp(.9rem, 2.4vw, 1.9rem);
  align-items: center;
}
.masthead nav a {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .6875rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color .18s ease;
}
.masthead nav a:hover { color: var(--ink); }

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

.hero { padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(2rem, 4vw, 3rem); }

.hero-head { max-width: 30ch; }

/* --- the plan: signature element ------------------------------- */

.plan {
  margin-top: clamp(2.5rem, 6vw, 4.25rem);
  border: 1px solid var(--edge);
  background: var(--surface);
  padding: clamp(.6rem, 1.6vw, 1rem);
}

.plan svg { display: block; width: 100%; height: auto; }

.plan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1.75rem;
  padding: .95rem .35rem .25rem;
  border-top: 1px solid var(--edge);
  margin-top: .75rem;
}
.plan-legend span { display: inline-flex; align-items: center; gap: .5rem; }
.plan-legend i {
  width: 11px; height: 11px;
  border: 1px solid currentColor;
  display: inline-block;
}
.legend-a { color: var(--zone-a); }
.legend-b { color: var(--zone-b); }

/* zone interaction */
.zone { cursor: pointer; }
.zone .zone-fill  { transition: fill-opacity .22s ease; }
.zone .zone-edge  { transition: stroke-width .22s ease, stroke .22s ease; }
.zone .zone-name  { transition: fill .22s ease; }
.zone:hover .zone-fill,
.zone:focus-visible .zone-fill { fill-opacity: .28; }
.zone:hover .zone-edge,
.zone:focus-visible .zone-edge { stroke-width: 2.4; }
.zone:hover .zone-name,
.zone:focus-visible .zone-name { fill: var(--ink); }

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

section { padding-block: var(--rhythm); }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  flex-wrap: wrap;
}

/* --- product entries ------------------------------------------- */

.entry {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 3.5rem);
  padding-block: clamp(2rem, 4vw, 2.9rem);
  border-top: 1px solid var(--edge);
}
.entry:last-of-type { border-bottom: 1px solid var(--edge); }

.entry-id { min-width: 0; }

.entry-name {
  font-variation-settings: "wdth" 120, "wght" 700;
  font-size: clamp(1.65rem, 1.3rem + 1.5vw, 2.3rem);
  line-height: 1;
  letter-spacing: -.018em;
  margin: .5rem 0 .55rem;
}
.entry-role {
  font-size: .9375rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

.entry-body > p { color: var(--muted); }
.entry-body > p strong {
  color: var(--ink);
  font-variation-settings: "wdth" 100, "wght" 600;
}

.facts {
  list-style: none;
  margin: 1.35rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.facts li {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .6875rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--edge-hi);
  padding: .3rem .55rem;
}

.visit {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.5rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .8125rem;
  letter-spacing: .04em;
  color: var(--brass);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--brass) 35%, transparent);
  padding-bottom: 2px;
  transition: border-color .18s ease;
}
.visit:hover { border-bottom-color: var(--brass); }
.visit::after { content: "→"; transition: transform .18s ease; }
.visit:hover::after { transform: translateX(3px); }

/* --- principles ------------------------------------------------ */

.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: clamp(1.5rem, 3.5vw, 2.75rem);
}
.principle { border-top: 2px solid var(--edge-hi); padding-top: 1.15rem; }
.principle p { color: var(--muted); font-size: .96875rem; }

/* --- company / colophon ---------------------------------------- */

.company {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--edge);
  background: var(--surface);
  padding: clamp(1.5rem, 4vw, 2.75rem);
}

.datum { margin: 0 0 1.15rem; }
.datum:last-child { margin-bottom: 0; }
.datum dt {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .6875rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: .3rem;
}
.datum dd {
  margin: 0;
  font-size: .96875rem;
  line-height: 1.5;
}
.datum dd a { color: var(--brass); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--brass) 35%, transparent); }
.datum dd a:hover { border-bottom-color: var(--brass); }

/* fill these in — deliberately loud until replaced */
.todo {
  background: color-mix(in srgb, var(--brass) 22%, transparent);
  border-bottom: 1px dashed var(--brass);
  color: var(--ink);
  padding: 0 .25rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .875em;
}

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

footer { padding: 2.1rem 0 3.25rem; }
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .85rem 1.75rem;
  align-items: baseline;
}
.foot nav { display: flex; gap: 1.35rem; flex-wrap: wrap; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* --- inner pages ----------------------------------------------- */

.doc { padding-block: clamp(3rem, 7vw, 5.5rem); }
.doc h2 { margin-top: 2.9rem; }
.doc h2:first-of-type { margin-top: 2rem; }
.doc p, .doc li { color: var(--muted); max-width: var(--measure); }
.doc ul { padding-left: 1.15rem; margin: 0 0 1.05rem; }
.doc li { margin-bottom: .4rem; }
.doc a { color: var(--brass); }
.back {
  display: inline-block;
  margin-bottom: 1.6rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .75rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.back:hover { color: var(--ink); }

/* --- narrow ---------------------------------------------------- */

@media (max-width: 40rem) {
  .entry { grid-template-columns: 1fr; gap: 1.1rem; }
  .masthead nav { gap: .9rem; }
}
