/* Haven Software — redesign mockup. Same palette as the live site, modernised layout. */
:root {
  --bg: #f4ecdd;
  --surface: #fffbf2;
  --surface-2: #efe6d2;
  --border: #e3d5bc;
  --border-strong: #cdbc9c;
  --primary: #7c8b5e;
  --primary-strong: #6c7b50;
  --primary-soft: #eae3cf;
  --on-primary: #fffbf2;
  --accent: #c2714b;
  --accent-2: #e0a33e;
  --text: #4a3b2e;
  --text-muted: #6e5c4a;
  --primary-text: #5a6840;
  --band: #5a6840;
  --booktrove: #4f7dbd;
  --pingsleuth: #0f6cbd;
  --glow-a: rgba(194, 113, 75, .16);
  --glow-b: rgba(124, 139, 94, .14);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 18px 40px -24px rgba(74, 59, 46, .45);
  --shadow-pop: 0 24px 60px -24px rgba(74, 59, 46, .5);
  --font-display: "Gloock", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, Menlo, monospace;
  --maxw: 1160px;
  --gutter: clamp(16px, 5vw, 48px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1813; --surface: #28211a; --surface-2: #322920; --border: #3d3227; --border-strong: #574737;
    --primary: #a3b47f; --primary-strong: #b3c48f; --primary-soft: #333524; --on-primary: #1d1813; --primary-text: #a3b47f; --band: #a3b47f;
    --accent: #e08a62; --accent-2: #e8b453; --text: #f1e7d6; --text-muted: #b3a189; --booktrove: #6d97d3; --pingsleuth: #1a7fd4;
    --glow-a: rgba(224, 138, 98, .12); --glow-b: rgba(163, 180, 127, .10);
    --shadow-card: 0 18px 40px -24px rgba(0, 0, 0, .7); --shadow-pop: 0 24px 60px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1d1813; --surface: #28211a; --surface-2: #322920; --border: #3d3227; --border-strong: #574737;
  --primary: #a3b47f; --primary-strong: #b3c48f; --primary-soft: #333524; --on-primary: #1d1813; --primary-text: #a3b47f; --band: #a3b47f;
  --accent: #e08a62; --accent-2: #e8b453; --text: #f1e7d6; --text-muted: #b3a189; --booktrove: #6d97d3; --pingsleuth: #1a7fd4;
  --glow-a: rgba(224, 138, 98, .12); --glow-b: rgba(163, 180, 127, .10);
  --shadow-card: 0 18px 40px -24px rgba(0, 0, 0, .7); --shadow-pop: 0 24px 60px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 600px at 95% -10%, var(--glow-a), transparent 60%),
    radial-gradient(700px 560px at -8% 30%, var(--glow-b), transparent 55%);
  background-repeat: no-repeat;
  color: var(--text); font-family: var(--font-body); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
main { flex: 1; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.05; margin: 0 0 .4em; letter-spacing: -.015em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
svg { display: block; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 10vw, 128px); }
.kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--primary-text); margin: 0 0 18px; display: inline-flex; align-items: center; gap: 10px; }
.kicker::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.lead { font-size: clamp(18px, 2.1vw, 21px); color: var(--text-muted); max-width: 54ch; }
.tbd { background: color-mix(in srgb, var(--accent-2) 22%, transparent); border-radius: 4px; padding: 0 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.skip-link { position: absolute; left: 16px; top: -80px; z-index: 100; padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 700; }
.skip-link:focus { top: 12px; color: var(--bg); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 700 15px/1 var(--font-body); padding: 15px 24px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--text); color: var(--bg); box-shadow: var(--shadow-card); }
.btn-primary:hover { color: var(--bg); background: color-mix(in srgb, var(--text) 88%, var(--accent)); }
.btn-ghost { background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.arrow { transition: transform .15s ease; }
a:hover .arrow { transform: translateX(3px); }
a:hover .arrow-out { transform: translate(2px, -2px); }

/* Nav */
.site-nav { position: sticky; top: 12px; z-index: 30; padding-inline: var(--gutter); margin-top: 12px; }
.nav-inner {
  max-width: calc(var(--maxw) - 2 * 24px); margin-inline: auto; height: 62px; padding: 0 10px 0 18px;
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(150%) blur(14px); -webkit-backdrop-filter: saturate(150%) blur(14px);
  border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-card);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-size: 19px; }
.brand:hover { color: var(--text); }
.brand-mark { width: 30px; height: 30px; }
.brand-light { color: var(--text-muted); }
.nav-links { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 600; }
.nav-links > a, .nav-trigger { color: var(--text-muted); padding: 9px 14px; border-radius: 999px; background: none; border: 0; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.nav-links > a:hover, .nav-trigger:hover, .nav-trigger[aria-expanded="true"], .nav-links > a.is-active { color: var(--text); background: var(--surface-2); }
.nav-trigger .chev { transition: transform .2s ease; }
.nav-trigger[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-end { display: flex; align-items: center; gap: 8px; }
.nav-cta { padding: 11px 18px; font-size: 14px; }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.menu-btn { display: none; }

/* Apps dropdown */
.has-menu { position: relative; }
.apps-menu {
  position: absolute; top: calc(100% + 14px); left: 50%; width: 400px; padding: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-pop);
  opacity: 0; visibility: hidden; transform: translate(-50%, -6px); transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.apps-menu.open { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.menu-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted); padding: 8px 12px 6px; margin: 0; }
.menu-item { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; color: var(--text); }
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item strong { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.menu-item span.sub { display: block; font-size: 13.5px; color: var(--text-muted); line-height: 1.4; font-weight: 400; }
.menu-item .ext { font-family: var(--font-mono); font-size: 10.5px; font-weight: 400; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; }
.menu-foot { margin-top: 6px; padding: 12px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-muted); }

/* App icons (shared) */
.app-icon { flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fffbf2; box-shadow: 0 8px 18px -10px rgba(74, 59, 46, .6); }
.app-icon.bt { background: #c9c9cb; overflow: hidden; }
.app-icon img, .tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-icon.ps { background: #1b77d2; overflow: hidden; }
.app-icon.next { background: transparent; border: 1.5px dashed var(--border-strong); color: var(--text-muted); box-shadow: none; }
.app-icon svg { width: 24px; height: 24px; }

/* Hero */
.hero { padding-block: clamp(56px, 9vw, 120px) clamp(48px, 8vw, 96px); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { font-size: clamp(44px, 7.4vw, 88px); margin-bottom: .32em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-art { position: relative; aspect-ratio: 1; max-width: 460px; width: 100%; margin-inline: auto; }
.hero-art .rings { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--border-strong); }
.tile {
  position: absolute; width: 40%; aspect-ratio: 1; border-radius: 26%; display: grid; place-items: center;
  box-shadow: var(--shadow-pop); transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.tile.bt { left: 12%; top: 18%; background: #c9c9cb; overflow: hidden; transform: rotate(-8deg); }
.tile.ps { right: 10%; top: 30%; background: #1b77d2; overflow: hidden; transform: rotate(7deg); }
.tile.ps svg { width: 48%; height: 48%; }
.tile.next { left: 32%; bottom: 8%; width: 30%; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 2px dashed var(--border-strong); color: var(--text-muted); box-shadow: none; transform: rotate(-3deg); backdrop-filter: blur(6px); }
.tile.next svg { width: 32%; height: 32%; }
a.tile { cursor: pointer; }
a.tile:hover, a.tile:focus-visible { color: #fffbf2; }
.tile.bt:hover, .tile.bt:focus-visible { transform: rotate(-11deg) translateY(-6px) scale(1.03); }
.tile.ps:hover, .tile.ps:focus-visible { transform: rotate(10deg) translateY(-6px) scale(1.03); }
a.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.tile.next { pointer-events: none; }
a.tile-label:hover { color: var(--text); border-color: var(--border-strong); }
.tile-label { position: absolute; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }

/* Section heads */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: clamp(32px, 5vw, 52px); flex-wrap: wrap; }
.section-head h2 { font-size: clamp(32px, 4.6vw, 54px); max-width: 16ch; margin: 0; }
.section-head p { color: var(--text-muted); max-width: 36ch; margin: 0; }
.section-head.long h2 { font-size: clamp(28px, 3.6vw, 44px); max-width: 30ch; line-height: 1.15; }

/* Apps bento */
.apps-grid { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: auto auto; gap: 18px; }
.app-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: clamp(24px, 3.4vw, 40px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 28px; box-shadow: var(--shadow-card);
  color: var(--text); overflow: hidden; transition: transform .2s ease, border-color .2s ease;
}
a.app-card:hover { color: var(--text); transform: translateY(-3px); border-color: var(--border-strong); }
.app-card.feature { grid-row: span 2; min-height: 460px; }
.app-card h3 { font-size: clamp(30px, 3.6vw, 44px); margin: 0; }
.app-card p { color: var(--text-muted); margin: 0; max-width: 44ch; }
.app-card .top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.chip { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap; }
.card-link { margin-top: auto; padding-top: 10px; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-weight: 700; color: var(--text); white-space: nowrap; }
.card-link .dest { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--text-muted); }
.bt-logo { display: flex; align-items: center; gap: 14px; }
.bt-logo .app-icon { width: 64px; height: 64px; border-radius: 18px; font-size: 28px; }
.placeholder-note { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: 6px; padding: 2px 6px; }
.bt-preview {
  position: relative; margin-top: 8px; flex: 1; min-height: 180px; border-radius: 20px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--booktrove) 18%, var(--surface-2)), var(--surface-2));
  border: 1px solid var(--border); overflow: hidden;
}
.shelf { position: absolute; left: 8%; right: 8%; bottom: 22%; display: flex; align-items: end; gap: 6px; }
.shelf span { display: block; border-radius: 4px 4px 2px 2px; box-shadow: inset -3px 0 0 rgba(0, 0, 0, .08); }
.shelf::after { content: ""; position: absolute; left: -4%; right: -4%; bottom: -10px; height: 10px; border-radius: 3px; background: var(--border-strong); }
.app-card.next { background: transparent; border-style: dashed; border-color: var(--border-strong); box-shadow: none; }
.app-card.next h3 { font-size: clamp(24px, 2.6vw, 30px); }

/* Principles */
.principles { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border-strong); }
.principle { padding: 28px 24px 8px 0; }
.principle + .principle { padding-left: 24px; border-left: 1px solid var(--border); }
.principle .num { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: .1em; }
.principle h3 { font-size: 23px; margin: 14px 0 10px; }
.principle p { color: var(--text-muted); font-size: 15.5px; margin: 0; }

/* About */
.about { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.about h2 { font-size: clamp(36px, 5vw, 60px); margin: 0; }
.about-body p { font-size: 18.5px; color: var(--text-muted); }
.about-body p:first-child { color: var(--text); font-size: clamp(20px, 2.3vw, 24px); line-height: 1.5; }

/* Contact band */
.contact {
  position: relative; overflow: hidden; border-radius: 36px; padding: clamp(36px, 6vw, 72px);
  background: var(--band); color: var(--on-primary);
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
}
.contact::before { content: ""; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--on-primary) 25%, transparent); box-shadow: 0 0 0 60px color-mix(in srgb, var(--on-primary) 5%, transparent), 0 0 0 120px color-mix(in srgb, var(--on-primary) 4%, transparent); }
.contact h2 { font-size: clamp(32px, 4.4vw, 52px); margin: 0 0 10px; color: var(--on-primary); }
.contact p { margin: 0; max-width: 46ch; }
.contact .btn { background: var(--on-primary); color: var(--text); position: relative; }
:root[data-theme="dark"] .contact .btn { color: var(--bg); background: var(--text); }

/* Footer */
.site-footer { margin-top: clamp(64px, 9vw, 112px); border-top: 1px solid var(--border); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; padding-block: 56px 40px; }
.footer-brand { max-width: 30ch; }
.footer-brand p { color: var(--text-muted); font-size: 14.5px; margin-top: 12px; }
.footer-cols { display: flex; gap: clamp(32px, 6vw, 72px); flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h2 { font-family: var(--font-mono); font-size: 11.5px; font-weight: 400; line-height: 1.4; letter-spacing: .18em; text-transform: uppercase; color: var(--primary-text); margin: 0 0 4px; }
.footer-col a { color: var(--text-muted); font-size: 14.5px; }
.footer-col a:hover { color: var(--text); }
.footer-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-block: 18px 30px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }

/* PingSleuth card preview — placeholder until its own brand exists */
.ps-preview { position: relative; margin-top: 8px; height: 120px; border-radius: 18px; overflow: hidden;
  background: radial-gradient(circle at 85% 130%, color-mix(in srgb, var(--pingsleuth) 35%, transparent), transparent 60%), var(--surface-2); border: 1px solid var(--border); }
.ps-preview svg { position: absolute; right: -30px; bottom: -80px; width: 240px; color: var(--pingsleuth); opacity: .55; }

/* Responsive */
@media (max-width: 900px) {
  .principles { grid-template-columns: 1fr 1fr; }
  .principle:nth-child(3) { padding-left: 0; border-left: 0; }
  .principle:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 820px) {
  .hero-grid, .about { grid-template-columns: 1fr; }
  .hero-art { max-width: 320px; order: -1; }
  .apps-grid { grid-template-columns: 1fr; }
  .app-card.feature { grid-row: auto; min-height: 0; }
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-links, .nav-cta { display: none; }
  .menu-btn { display: inline-grid; }
  .nav-links.mobile-open {
    display: flex; flex-direction: column; align-items: stretch; position: absolute; top: calc(100% + 10px); left: var(--gutter); right: var(--gutter);
    background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 10px; box-shadow: var(--shadow-pop);
  }
  .nav-links.mobile-open .apps-menu { position: static; width: auto; transform: none; box-shadow: none; border: 0; padding: 0 0 0 8px; opacity: 1; visibility: visible; display: none; }
  .nav-links.mobile-open .apps-menu.open { display: block; }
  .nav-links.mobile-open .menu-foot, .nav-links.mobile-open .ext { display: none; }
}
@media (max-width: 560px) {
  .principles { grid-template-columns: 1fr; }
  .principle, .principle + .principle { padding-left: 0; border-left: 0; }
  .principle + .principle { border-top: 1px solid var(--border); }
  .site-nav .brand { font-size: 16.5px; gap: 8px; white-space: nowrap; }
  .nav-inner { padding-left: 14px; gap: 8px; }
  .nav-end { gap: 6px; }
  .site-nav .brand-mark { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* Theme toggle shows the theme you'd switch to */
.icon-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: block; }
:root[data-theme="dark"] .icon-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .moon { display: none; }
}

@media (max-width: 360px) { .site-nav .brand { font-size: 15px; } }
