/* Shared styles for magnusopi.com public pages (home, /ai/). The /plan pages use plan/plan.css. */
:root {
  --bg: #0f0e0b;
  --surface: #18160f;
  --soft: #221f16;
  --ink: #f4efe4;
  --muted: #b9b09d;
  --line: #342f24;
  --accent: #e3b45a;
  --accent-fill: #d6a344;
  --accent-fill-hover: #e6b555;
  --on-accent: #1a1306;
  --glow: rgba(214, 163, 68, 0.22);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.7);

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1160px;
  --gutter: 24px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f3ea;
    --surface: #fffdf8;
    --soft: #f0eadc;
    --ink: #1b1811;
    --muted: #5c5444;
    --line: #e2dac8;
    --accent: #8a5a0e;
    --accent-fill: #d6a344;
    --accent-fill-hover: #c99536;
    --on-accent: #1a1306;
    --glow: rgba(214, 163, 68, 0.28);
    --shadow: 0 20px 40px -28px rgba(60, 40, 10, 0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 600; }
p { margin: 0; text-wrap: pretty; }

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

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 20;
  background: var(--accent-fill); color: var(--on-accent);
  padding: 10px 14px; border-radius: var(--r-sm); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

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

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.lockup {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font: 600 22px/1 var(--display); letter-spacing: -0.01em;
}
.lockup svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 8px 12px; border-radius: var(--r-sm); transition: color .15s, background-color .15s;
}
.nav a:hover { color: var(--ink); background: var(--soft); }
.nav a[aria-current="page"] { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--r-sm);
  font: 600 15px/1 var(--body); text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.btn-primary { background: var(--accent-fill); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-fill-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn[hidden] { display: none; }
.btn-quiet { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.btn-quiet:hover { border-color: var(--muted); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn svg { width: 18px; height: 18px; }

/* Hero */
.hero { padding: 88px 0 96px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-block; margin-bottom: 20px;
  color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.hero h1 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(44px, 6.4vw, 78px); letter-spacing: -0.025em; line-height: 1.02;
  text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { margin-top: 24px; max-width: 34ch; font-size: 19px; color: var(--muted); }
.hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 36px; }
.hero .aside { font-size: 14px; color: var(--muted); }

.art {
  position: relative; aspect-ratio: 1 / 0.92; border-radius: var(--r-lg);
  background:
    radial-gradient(60% 55% at 50% 48%, var(--glow), transparent 70%),
    linear-gradient(160deg, var(--soft), var(--surface));
  border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden;
}
.art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.art .ring-slow { transform-origin: 300px 276px; animation: spin 90s linear infinite; }
.art .ring-fast { transform-origin: 300px 276px; animation: spin 60s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Sections */
section.block { padding: 88px 0; border-top: 1px solid var(--line); }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 36px; }
.block-head h2 { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 3.6vw, 40px); letter-spacing: -0.02em; }
.block-head p { color: var(--muted); font-size: 16px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; list-style: none; margin: 0; padding: 0; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 28px; box-shadow: var(--shadow);
}
.icon {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 22px;
  border-radius: 10px; background: var(--soft); border: 1px solid var(--line); color: var(--accent);
}
.icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 19px; font-weight: 600; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15.5px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { position: relative; padding: 28px 28px 0 0; border-top: 2px solid var(--line); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  position: absolute; top: -2px; left: 0; width: 48px; border-top: 2px solid var(--accent-fill);
  padding-top: 14px; color: var(--accent); font: 600 14px/1 var(--body); letter-spacing: .08em;
}
.step h3 { margin-top: 26px; font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 15.5px; }

/* Contact */
.contact { padding: 0 0 96px; }
.contact-panel {
  position: relative; overflow: hidden; text-align: center;
  padding: 72px 32px 40px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: radial-gradient(70% 90% at 50% 0%, var(--glow), transparent 70%), var(--surface);
  box-shadow: var(--shadow);
}
.contact-panel h2 { font-family: var(--display); font-weight: 500; font-size: clamp(32px, 4.4vw, 50px); letter-spacing: -0.02em; }
.contact-panel p { margin: 16px auto 0; max-width: 44ch; color: var(--muted); font-size: 17px; }
.contact-panel .actions { margin-top: 32px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.copy-note { min-height: 20px; margin-top: 12px; font-size: 14px; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.site-footer .lockup { font-size: 18px; color: var(--ink); }
.site-footer .lockup svg { width: 24px; height: 24px; }
.site-footer a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }
.site-footer a:hover { text-decoration-color: currentColor; }

/* Responsive */
@media (max-width: 960px) {
  .hero { padding: 56px 0 72px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 48px; }
  .hero .lede { max-width: 44ch; }
  .art { aspect-ratio: 16 / 10; }
  .cards, .steps { grid-template-columns: 1fr; }
  .cards { gap: 14px; }
  .steps { gap: 36px; }
  .step { padding-right: 0; }
  section.block { padding: 64px 0; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  html { scroll-padding-top: 116px; }
  .site-header .wrap { height: auto; min-height: 60px; flex-wrap: wrap; gap: 0 12px; padding-top: 10px; }
  .nav {
    order: 3; width: calc(100% + 2 * var(--gutter)); margin: 6px calc(-1 * var(--gutter)) 0; padding: 0 calc(var(--gutter) - 12px) 6px;
    overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line);
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav::after { content: ""; flex: none; width: 32px; }
  .nav a { flex: none; font-size: 14px; padding: 10px 12px; }
  .site-header .btn { margin-left: auto; min-height: 40px; padding: 0 16px; font-size: 14px; }
  .lockup { font-size: 20px; }
  .hero { padding: 40px 0 56px; }
  .hero .lede { font-size: 17px; }
  .hero .actions .btn { width: 100%; }
  .art { aspect-ratio: 1 / 0.8; }
  .card { padding: 22px; }
  .contact-panel { padding: 48px 20px 36px; }
  .contact-panel .btn { width: 100%; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}

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

/* Page hero without art (inner pages) */
.page-hero { padding: 80px 0 72px; }
.page-hero h1 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(40px, 5.6vw, 66px); letter-spacing: -0.025em; line-height: 1.04; text-wrap: balance; max-width: 18ch;
}
.page-hero h1 em { font-style: italic; color: var(--accent); }
.page-hero .lede { margin-top: 22px; max-width: 46ch; font-size: 19px; color: var(--muted); }
.page-hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 32px; }
.page-hero .aside { font-size: 14px; color: var(--muted); }

/* Lead service card on the home page */
.feature {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center;
  background: radial-gradient(80% 120% at 100% 0%, var(--glow), transparent 60%), var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 40px; box-shadow: var(--shadow);
}
.feature h3 { font-family: var(--display); font-weight: 500; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.015em; margin-bottom: 12px; }
.feature p { color: var(--muted); font-size: 16.5px; }
.feature .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 30px; color: var(--ink); font-size: 15.5px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--soft); border: 1px solid var(--line);
}
.ticks li::after {
  content: ""; position: absolute; left: 6px; top: 7px; width: 5px; height: 8px;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.ticks.muted li { color: var(--muted); }

/* Packages */
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; list-style: none; margin: 0; padding: 0; }
.plan {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; box-shadow: var(--shadow);
}
.plan.lead { border-color: color-mix(in srgb, var(--accent-fill) 60%, var(--line)); }
.plan .tag { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.plan h3 { font-size: 19px; }
.plan .price { color: var(--ink); font: 500 30px/1.1 var(--display); letter-spacing: -0.01em; }
.plan .price small { display: block; margin-top: 4px; font: 500 14px/1.4 var(--body); color: var(--muted); letter-spacing: 0; }
.plan p { color: var(--muted); font-size: 15px; }
.plan .ticks { margin-top: 6px; gap: 8px; }
.plan .ticks li { font-size: 14.5px; }
.fineprint { margin-top: 20px; color: var(--muted); font-size: 14px; max-width: 80ch; }

/* Builds */
.builds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; list-style: none; margin: 0; padding: 0; }
.build { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 28px; box-shadow: var(--shadow); }
.build h3 { font-size: 19px; margin-bottom: 8px; }
.build p { color: var(--muted); font-size: 15.5px; }
.build dl { margin: 18px 0 0; display: grid; gap: 10px; font-size: 14.5px; }
.build dt { color: var(--accent); font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.build dd { margin: 2px 0 0; color: var(--ink); }

/* Who it's for */
.who { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.who li { padding: 22px 24px 22px 0; border-bottom: 1px solid var(--line); }
.who h3 { font-size: 17px; margin-bottom: 6px; }
.who p { color: var(--muted); font-size: 15px; }

/* Two columns of limits */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split .card h3 { margin-bottom: 16px; }

/* Questions */
.faq { max-width: 820px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative;
  font-weight: 600; font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 26px; width: 9px; height: 9px;
  border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s;
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 30px; }
.faq details p { padding: 0 0 22px; color: var(--muted); font-size: 15.5px; max-width: 70ch; }

.site-footer .facts { display: flex; flex-wrap: wrap; gap: 6px 18px; }

@media (max-width: 1100px) {
  .plans { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .feature { grid-template-columns: 1fr; padding: 32px; }
  .builds, .split { grid-template-columns: 1fr; }
  .who { grid-template-columns: 1fr 1fr; }
  .page-hero { padding: 56px 0 56px; }
}
@media (max-width: 640px) {
  .plans, .who { grid-template-columns: 1fr; }
  .feature { padding: 24px; }
  .feature .actions .btn, .page-hero .actions .btn { width: 100%; }
  .page-hero { padding: 40px 0 48px; }
  .page-hero .lede { font-size: 17px; }
  .build, .plan { padding: 22px; }
}

/* Team hub (magnusopi.org) */
.team-tag {
  margin-left: 4px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); font: 600 11px/1 var(--body); letter-spacing: .12em; text-transform: uppercase;
}
.cards a.card { display: block; text-decoration: none; transition: border-color .15s; }
.cards a.card:hover { border-color: var(--muted); }
.cards a.card .go { margin-top: 14px; color: var(--accent); font-size: 14px; font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
table.data th, table.data td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--line); }
table.data th { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
table.data tr:last-child td { border-bottom: 0; }
table.data td:first-child { font-weight: 600; white-space: nowrap; }
table.data td { color: var(--muted); }
table.data td.num { color: var(--ink); white-space: nowrap; }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.todo li { position: relative; padding-left: 30px; font-size: 15px; color: var(--ink); }
.todo li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid var(--muted);
}
.todo li span { display: block; color: var(--muted); font-size: 14px; }
.steps.seven { grid-template-columns: repeat(4, 1fr); row-gap: 36px; }
@media (max-width: 960px) { .steps.seven { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .steps.seven { grid-template-columns: 1fr; } .team-tag { display: none; } }

/* Request form (/ai/) */
.contact-panel.request { text-align: left; padding: 56px 48px 40px; }
.contact-panel.request h2, .contact-panel.request > p { text-align: center; }
.intake { max-width: 760px; margin: 32px auto 0; display: grid; gap: 18px; }
.intake .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.intake label, .intake legend { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.intake label > input:not([type="radio"]), .intake label > textarea { flex: 0 0 100%; }
.intake .req, .intake .opt { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.intake input:not([type="radio"]), .intake textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: 400 16px/1.4 var(--body);
}
.intake textarea { resize: vertical; min-height: 110px; }
.intake input:focus, .intake textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.intake ::placeholder { color: var(--muted); opacity: .8; }
.intake fieldset { border: 0; margin: 0; padding: 0; }
.intake legend { margin-bottom: 10px; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choices label {
  display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--r-sm); font-weight: 500; cursor: pointer;
}
.choices input { accent-color: var(--accent-fill); width: 18px; height: 18px; margin: 0; }
.choices label:has(input:checked) { border-color: var(--accent-fill); background: var(--soft); }
.intake .trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.intake .send { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 4px; }
.intake .small, .contact-panel .alt { font-size: 14px; color: var(--muted); }
.contact-panel .alt { margin-top: 28px; text-align: center; }
.contact-panel a:not(.btn), .intake a { color: var(--accent); text-underline-offset: 3px; }
.form-alert {
  display: none; max-width: 760px; margin: 24px auto 0; padding: 14px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--accent-fill); background: var(--soft); color: var(--ink); font-size: 15px;
}
.form-alert:target { display: block; }
.person { margin-top: 20px; padding: 24px 28px; border-left: 3px solid var(--accent-fill); background: var(--surface); border-radius: 0 var(--r-md) var(--r-md) 0; }
.person h3 { font-size: 17px; margin-bottom: 6px; }
.person p { color: var(--muted); font-size: 15.5px; max-width: 72ch; }

/* Plain text pages (privacy, thanks) */
.prose { max-width: 70ch; }
.prose h2 { font-family: var(--display); font-weight: 500; font-size: 26px; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--muted); font-size: 16px; }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 20px; display: grid; gap: 6px; }
.prose a { color: var(--accent); }

/* Visit requests (team hub) */
.enquiries { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.enquiry h3 { font-size: 19px; margin-bottom: 4px; }
.enquiry h3 small { color: var(--muted); font-weight: 500; font-size: 15px; }
.enquiry p { margin-top: 8px; }
.enquiry .meta { color: var(--muted); font-size: 14px; }
.enquiry .help { color: var(--ink); white-space: normal; }
.enquiry a { color: var(--accent); }

@media (max-width: 640px) {
  .contact-panel.request { padding: 40px 18px 28px; }
  .intake .row { grid-template-columns: 1fr; }
  .intake .send .btn { width: 100%; }
  .person { padding: 20px; }
}
