/* ==========================================================================
   Fermisense — neutral editorial system
   Shared across index.html and all use-case pages.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #faf9f6;
  --surface-2: #f3f1ec;
  --ink: #0a0a0a;
  --text: #3f3f3f;
  --text-soft: #525252;
  --muted: #737373;
  --subtle: #a3a3a3;
  --line: #e8e5dc;
  --line-strong: #d6d2c5;
  --accent: #18181b;
  --warm: #b08847;
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.04);
  --shadow-md: 0 4px 18px rgba(10, 10, 10, 0.05);
  --radius-sm: 0.45rem;
  --radius: 0.65rem;
  --radius-lg: 1.05rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "ss01", "cv11", "calt";
  font-variant-numeric: lining-nums;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; }

::selection { background: var(--ink); color: var(--bg); }

/* --- Page paper texture (very subtle, neutral) ----------------------------- */

.paper {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 600px at 8% -10%, rgba(176, 136, 71, 0.05), transparent 60%),
    radial-gradient(900px 500px at 95% 5%, rgba(10, 10, 10, 0.025), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
}

/* --- Header ---------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding: 1.05rem 0;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 1.7rem;
  height: 1.7rem;
  color: var(--ink);
  flex-shrink: 0;
  display: block;
  overflow: visible;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-mark .tri-edge {
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  fill: none;
}

.brand-mark .tri-node {
  fill: currentColor;
}

.brand-mark .tri-center {
  fill: var(--warm);
}

.brand:hover .brand-mark {
  transform: rotate(120deg);
}

.brand-name {
  font-family: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  font-weight: 400;
  font-size: 1.45rem;
  letter-spacing: -0.012em;
  line-height: 1;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
}

.nav-cta {
  margin-left: auto;
}

.nav-link,
.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.nav-link:hover,
.nav-trigger:hover,
.nav-link.is-active {
  color: var(--ink);
  background: var(--surface-2);
}

.nav-trigger::after {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.55;
  transition: transform 0.18s ease;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown:hover .nav-trigger::after,
.nav-dropdown:focus-within .nav-trigger::after {
  transform: translateY(0) rotate(225deg);
}

.nav-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  margin: 0;
  padding: 0.55rem;
  min-width: 340px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 1200;
}

.nav-dropdown:hover .nav-panel,
.nav-dropdown:focus-within .nav-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-panel-item {
  list-style: none;
}

.nav-panel-link,
.nav-panel-static {
  display: block;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease;
}

.nav-panel-link:hover {
  background: var(--surface);
}

.nav-panel-title {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: -0.005em;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.nav-panel-desc {
  margin: 0.22rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.coming-soon {
  font-size: 0.73rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
  border: 1px solid var(--line);
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
}

/* --- Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.74rem 1.25rem;
  font-size: 0.93rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
              background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  color: #fafaf7;
  background: var(--ink);
  border-color: var(--ink);
}

.btn-primary:hover {
  background: #1f1f1f;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(10, 10, 10, 0.16);
}

.btn-ghost {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  background: var(--surface);
  transform: translateY(-1px);
}

.btn-arrow::after {
  content: "→";
  font-size: 1em;
  transform: translateX(0);
  transition: transform 0.18s ease;
}

.btn-arrow:hover::after {
  transform: translateX(3px);
}

/* --- Layout primitives ----------------------------------------------------- */

.container {
  width: min(1180px, 92vw);
  margin: 0 auto;
}

main { display: block; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: var(--line-strong);
}

.eyebrow.no-rule::before { display: none; }

h1, h2, h3, h4 {
  font-family: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0;
}

.h-display {
  font-size: clamp(2.7rem, 6vw, 5.1rem);
  line-height: 1.04;
  letter-spacing: -0.028em;
}

.h-section {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.italic-serif {
  font-style: italic;
  color: var(--text-soft);
}

.lede {
  font-size: clamp(1.04rem, 1.4vw, 1.16rem);
  line-height: 1.62;
  color: var(--text-soft);
  max-width: 58ch;
}

.muted-line {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.6;
}

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

.site-footer {
  margin-top: 6rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.site-footer-inner {
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding: 3.2rem 0 2.4rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.footer-brand p {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 32ch;
}

.footer-col h4 {
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 0.9rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-col a,
.footer-col span {
  color: var(--text);
  text-decoration: none;
  font-size: 0.94rem;
  transition: color 0.15s ease;
}

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

.footer-col span.disabled {
  color: var(--subtle);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.footer-bottom {
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding: 1.4rem 0 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

/* --- Reveal animations ----------------------------------------------------- */

.fade-in,
.reveal {
  opacity: 0;
  transform: translateY(14px);
}

.fade-in {
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.06s; }
.delay-2 { animation-delay: 0.14s; }
.delay-3 { animation-delay: 0.22s; }
.delay-4 { animation-delay: 0.30s; }
.delay-5 { animation-delay: 0.38s; }

.reveal.show {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Use-case page shared layout ------------------------------------------ */

.uc-hero {
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding: 5rem 0 2.4rem;
  position: relative;
}

.uc-hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: end;
}

.uc-h1 {
  margin-top: 1.2rem;
  font-size: clamp(2.4rem, 5.5vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
  max-width: 14ch;
}

.uc-lede {
  margin-top: 1.5rem;
  font-size: clamp(1.06rem, 1.55vw, 1.22rem);
  line-height: 1.65;
  color: var(--text-soft);
  max-width: 60ch;
}

.uc-side {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.uc-side-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed var(--line-strong);
}

.uc-side-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.uc-side-row dt {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.uc-side-row dd {
  margin: 0;
  font-size: 0.96rem;
  text-align: right;
  color: var(--text);
  font-weight: 500;
}

.uc-section {
  width: min(1180px, 92vw);
  margin: 3.6rem auto 0;
}

.uc-eyebrow {
  margin: 0 0 0.6rem;
}

.uc-section-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.12;
  letter-spacing: -0.018em;
  max-width: 30ch;
}

.uc-cards {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #ffffff;
  overflow: hidden;
}

.uc-card {
  padding: 1.7rem 1.6rem 1.8rem;
  border-right: 1px solid var(--line);
}

.uc-card:last-child { border-right: none; }

.uc-card .num {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--subtle);
  letter-spacing: 0.06em;
}

.uc-card h3 {
  font-family: "Instrument Serif", serif;
  font-size: 1.55rem;
  line-height: 1.18;
  margin: 0.7rem 0 0.55rem;
}

.uc-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.97rem;
  line-height: 1.65;
}

.uc-narrative {
  margin-top: 2.4rem;
  display: grid;
  grid-template-columns: 0.85fr 1.5fr;
  gap: 3rem;
}

.uc-narrative .lead-q {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  line-height: 1.25;
  color: var(--ink);
  margin: 0.8rem 0 0;
  max-width: 22ch;
}

.uc-narrative-body p {
  margin: 0 0 1.15rem;
  font-size: 1.04rem;
  line-height: 1.72;
  color: var(--text);
}

.uc-narrative-body p:last-child { margin-bottom: 0; }

.uc-narrative-body em,
.uc-narrative-body .accent {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  color: var(--ink);
}

.uc-quote {
  margin-top: 3rem;
  padding: 2rem 2.2rem;
  border-left: 2px solid var(--line-strong);
  background: var(--surface);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  line-height: 1.4;
  color: var(--ink);
  max-width: 60ch;
}

.uc-quote-attribution {
  display: block;
  margin-top: 1rem;
  font-family: "Inter", sans-serif;
  font-style: normal;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.uc-checklist {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 1.6rem;
}

.uc-checklist li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
}

.uc-checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at center, var(--ink) 0 0.18rem, transparent 0.18rem);
}

.uc-cta {
  margin: 4rem auto 5rem;
  width: min(1180px, 92vw);
  padding: 2.6rem 2.8rem;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: #fafaf7;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.8rem;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.uc-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 400px at 0% 100%, rgba(176, 136, 71, 0.12), transparent 60%);
  pointer-events: none;
}

.uc-cta > * { position: relative; }

.uc-cta h2 {
  color: #fafaf7;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15;
  max-width: 22ch;
}

.uc-cta p {
  margin: 0.7rem 0 0;
  color: #d4d2cc;
  line-height: 1.6;
  max-width: 42ch;
}

.uc-cta .actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: stretch;
  justify-self: end;
}

.uc-cta .btn-primary {
  background: #fafaf7;
  color: var(--ink);
  border-color: #fafaf7;
}

.uc-cta .btn-primary:hover { background: #ffffff; }

.uc-cta .btn-ghost {
  color: #fafaf7;
  border-color: rgba(250, 250, 247, 0.25);
}

.uc-cta .btn-ghost:hover { background: rgba(250, 250, 247, 0.08); }

@media (max-width: 920px) {
  .uc-hero { padding: 3rem 0 1.8rem; }

  .uc-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }

  .uc-h1 { max-width: none; }

  .uc-section { margin-top: 2.6rem; }

  .uc-cards { grid-template-columns: 1fr; margin-top: 1.6rem; }
  .uc-card {
    padding: 1.6rem 1.5rem 1.7rem;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .uc-card:last-child { border-bottom: none; }

  .uc-narrative {
    margin-top: 1.8rem;
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .uc-narrative .lead-q { max-width: none; }

  .uc-checklist {
    grid-template-columns: 1fr;
    margin-top: 1.6rem;
    gap: 0.7rem;
  }

  .uc-quote {
    margin-top: 2rem;
    padding: 1.6rem 1.5rem;
  }

  .uc-cta {
    margin: 3rem auto 3.5rem;
    grid-template-columns: 1fr;
    padding: 2rem 1.6rem;
    gap: 1.3rem;
  }
  .uc-cta h2 { max-width: none; }
  .uc-cta .actions {
    justify-self: stretch;
    gap: 0.55rem;
  }
  .uc-cta .actions .btn { width: 100%; }
}

@media (max-width: 560px) {
  .uc-hero { padding: 2.4rem 0 1.4rem; }
  .uc-h1 { font-size: clamp(2rem, 8vw, 2.8rem); }

  .uc-side { padding: 1.1rem 1.15rem; gap: 0.8rem; }
  .uc-side-row { padding-bottom: 0.7rem; }
  .uc-side-row dt { font-size: 0.68rem; }
  .uc-side-row dd { font-size: 0.9rem; }

  .uc-card h3 { font-size: 1.4rem; }

  .uc-narrative .lead-q { font-size: 1.25rem; }
  .uc-narrative-body p { font-size: 0.99rem; }
}

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

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

  .footer-bottom {
    flex-direction: column;
    gap: 0.6rem;
    text-align: center;
  }
}

@media (max-width: 760px) {
  .nav {
    padding: 0.85rem 0;
    flex-wrap: wrap;
    gap: 0.55rem;
  }

  .brand-name { font-size: 1.3rem; }

  .nav-menu {
    order: 3;
    position: relative;
    width: 100%;
    margin-left: 0;
    margin-top: 0.4rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
  }

  .nav-dropdown {
    position: static;
  }

  .nav-cta {
    margin-left: auto;
    padding: 0.58rem 0.95rem;
    font-size: 0.86rem;
  }

  .nav-link,
  .nav-trigger {
    width: 100%;
    justify-content: center;
    font-size: 0.84rem;
    padding: 0.5rem 0.4rem;
    background: var(--surface);
    border-color: var(--line);
  }

  .nav-trigger::after {
    width: 0.32rem;
    height: 0.32rem;
  }

  .nav-panel {
    left: 0;
    right: 0;
    top: calc(100% + 0.4rem);
    transform: translateY(-4px);
    width: auto;
    min-width: 0;
    padding: 0.45rem;
  }

  .nav-panel-title { font-size: 0.92rem; }
  .nav-panel-desc { font-size: 0.82rem; }

  .nav-dropdown:hover .nav-panel,
  .nav-dropdown:focus-within .nav-panel {
    transform: translateY(0);
  }

  .site-footer { margin-top: 4rem; }

  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: 1.8rem;
    padding: 2.6rem 0 2rem;
  }

  .footer-bottom {
    padding: 1.2rem 0 1.6rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 420px) {
  .nav-menu {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.3rem;
  }

  .nav-link,
  .nav-trigger {
    font-size: 0.78rem;
    padding: 0.45rem 0.3rem;
  }
}
