/* FFE Habitat — company portal. Palette: paper, ink and gold (DESIGN.md §5). */

:root {
  --paper: #f4efe6;
  --paper-2: #faf6ee;
  --paper-3: #ece4d6;
  --paper-line: #d4c6b0;
  --navy: #0b1524;
  --muted: #8a7b6a;

  --ink: #101214;
  --ink-2: #181b1e;
  --ink-line: #2a2f34;
  --ink-text: #e8eaed;
  --ink-muted: #9aa3ad;

  --gold: #c2a07a;
  --gold-hi: #c9a227;
  --quiet: #4f8a63;
  --danger: #c45c4a;

  --radius: 14px;
  --wrap: 1180px;
  --pad: clamp(20px, 4vw, 40px);
  --sec: clamp(72px, 11vw, 140px);

  --font: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--navy);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: 0.01em; line-height: 1.25; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.muted { color: var(--muted); }
.dark .muted { color: var(--ink-muted); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(16, 18, 20, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  color: var(--ink-text);
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--ink-line); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 22px; height: 3px; background: var(--gold-hi); }
.brand-name { font-size: 17px; letter-spacing: 0.04em; font-weight: 500; }
.brand-name b { font-weight: 700; }
.nav { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.nav a { text-decoration: none; color: var(--ink-muted); transition: color .15s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink-text); }
.nav a.btn { color: var(--ink); }
.nav-toggle { display: none; width: 40px; height: 40px; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: var(--ink-text); margin: 6px 0; transition: transform .2s; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 26px;
  font: 600 15px/1 var(--font); letter-spacing: 0.04em;
  text-decoration: none; border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn-gold { background: var(--gold-hi); color: var(--ink); }
.btn-gold:hover { background: #d8b23a; }
.btn-line { border-color: var(--ink-line); color: var(--ink-text); }
.btn-line:hover { border-color: var(--ink-muted); }

/* Sections */
.section { padding: var(--sec) 0; position: relative; }
.dark { background: var(--ink); color: var(--ink-text); }
.paper-deep { background: var(--paper-3); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.12em; color: var(--muted);
  margin-bottom: 20px;
}
.dark .eyebrow { color: var(--ink-muted); }
.bar { width: 28px; height: 3px; background: var(--gold-hi); display: inline-block; }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head h2, .about h2, .contact h2 { font-size: clamp(30px, 4.4vw, 50px); }
.section-lead { margin-top: 20px; font-size: clamp(16px, 1.6vw, 18px); color: #3c4656; }
.dark .section-lead { color: var(--ink-muted); }

/* Hero */
.hero { padding: clamp(56px, 9vw, 120px) 0 clamp(56px, 7vw, 96px); overflow: hidden; }
.grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 30%, transparent 75%);
}
.hero-row { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 5vw, 72px); align-items: center; position: relative; }
.hero h1 { font-size: clamp(38px, 5vw, 64px); line-height: 1.12; letter-spacing: 0.005em; }
.hero .lead { margin-top: 28px; max-width: 560px; font-size: clamp(16px, 1.6vw, 18px); color: var(--ink-muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.br-sm { display: none; }

.hero-visual { position: relative; height: clamp(440px, 52vw, 620px); }
.phone {
  margin: 0; background: #000; padding: 8px;
  border-radius: 34px; border: 1px solid #2f3439;
  box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.03) inset;
  overflow: hidden;
}
.phone img { border-radius: 26px; }
.phone.android { border-radius: 18px; }
.phone.android img { border-radius: 10px; }
.hero-visual .phone { position: absolute; width: clamp(200px, 21vw, 270px); }
.phone-front { left: 4%; top: 6%; z-index: 2; }
.phone-back { right: 2%; top: 0; transform: translateY(8%); opacity: .9; }
.shot-note { position: absolute; right: 2%; bottom: -6px; font-size: 12px; color: var(--ink-muted); letter-spacing: .08em; }

.proof {
  margin: clamp(48px, 7vw, 88px) 0 0; display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink-line);
}
.proof > div { padding: 28px 24px 0 0; }
.proof > div + div { padding-left: 24px; border-left: 1px solid var(--ink-line); }
.proof dt { font-size: clamp(26px, 3vw, 36px); font-weight: 700; color: var(--ink-text); }
.proof dd { margin: 6px 0 0; font-size: 13px; color: var(--ink-muted); line-height: 1.6; }

/* Triad */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--ink-line); border: 1px solid var(--ink-line); border-radius: var(--radius); overflow: hidden; }
.card { background: var(--ink-2); padding: clamp(26px, 3vw, 40px); display: flex; flex-direction: column; transition: background .2s; }
.card:hover { background: #1c2024; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.card-no { font: 600 13px/1 var(--mono); color: var(--gold-hi); letter-spacing: .08em; }
.card h3 { margin-top: 18px; font-size: clamp(19px, 1.9vw, 23px); }
.card > p:not(.card-no) { margin-top: 12px; color: var(--ink-muted); font-size: 15px; max-width: 62ch; }
.spec { list-style: none; margin: auto 0 0; padding: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.spec li { font: 500 12px/1 var(--mono); color: var(--ink-text); border: 1px solid var(--ink-line); padding: 8px 10px; }

/* Gallery */
.gallery-shell { position: relative; }
.gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(220px, 24vw, 280px); gap: clamp(20px, 3vw, 36px);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: max(var(--pad), calc((100vw - var(--wrap)) / 2 + var(--pad)));
  padding: 8px max(var(--pad), calc((100vw - var(--wrap)) / 2 + var(--pad))) 28px;
  scrollbar-width: none; outline: none;
}
.gallery::-webkit-scrollbar { display: none; }
.shot { margin: 0; scroll-snap-align: start; display: flex; flex-direction: column; }
.shot .phone { padding: 6px; border-radius: 30px; box-shadow: 0 20px 50px rgba(11,21,36,.18); background: #000; }
.shot .phone img { border-radius: 24px; }
.shot .phone.android { border-radius: 16px; }
/* iPhone Air outline: thin light rim, slim bezel, screen at the device's 420:912 points; shots sit top-aligned */
.phone.air, .shot .phone.air {
  padding: 2.2%; border-radius: 13% / 6%; background: #0b0c0d;
  border: 1.5px solid #8d949b; box-shadow: 0 0 0 1px #3a3f44, 0 26px 60px rgba(11,21,36,.28);
  position: relative;
}
.phone.air .screen { aspect-ratio: 420 / 912; border-radius: 11.5% / 5.3%; overflow: hidden; background: #121416; }
.phone.air .screen img { width: 100%; height: auto; border-radius: 0; }
.hero-visual .phone.air { position: absolute; }
.phone.air.full::after {
  content: ""; position: absolute; top: 3.4%; left: 50%; width: 27%; height: 2.6%;
  transform: translateX(-50%); background: #000; border-radius: 999px;
}
.shot .phone.android img { border-radius: 10px; }
.shot figcaption { margin-top: 18px; font-size: 14px; color: #3c4656; line-height: 1.7; }
.shot figcaption b { display: block; font-size: 16px; color: var(--navy); margin-bottom: 4px; }
.gallery-nav { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.icon-btn {
  width: 48px; height: 48px; border: 1px solid var(--paper-line); background: var(--paper-2);
  font-size: 18px; cursor: pointer; color: var(--navy); transition: border-color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--navy); }

/* Home: one AI mood image, then a real plan render (DESIGN.md §8) */
.moods { display: grid; grid-template-columns: 1fr; gap: 16px; }
.mood { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--paper-3); }
.plan-render { margin: 0; display: grid; grid-template-columns: 3fr 2fr; gap: 32px; align-items: center;
  padding: 28px 32px; border-radius: var(--radius); background: var(--paper-3); }
.plan-render img { width: 100%; height: auto; }
.plan-render .card-no { color: var(--gold); }
.plan-render h3 { margin-top: 10px; font-size: 21px; }
.plan-render figcaption p:last-child { margin-top: 12px; color: var(--muted); font-size: 15px; }
.mood img { width: 100%; height: 100%; object-fit: cover; }
.mood-slot { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed var(--paper-line); border-radius: var(--radius); color: var(--muted); font: 500 13px/1.4 var(--mono); }
.mood-note { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* Beliefs */
.beliefs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--paper-line); border: 1px solid var(--paper-line); border-radius: var(--radius); overflow: hidden; }
.beliefs article { background: var(--paper-2); padding: 28px 24px 32px; }
.beliefs .card-no { color: var(--gold); }
.beliefs h3 { margin-top: 14px; font-size: 19px; }
.beliefs p:not(.card-no) { margin-top: 10px; font-size: 15px; color: #3c4656; }

/* Scenes */
.scenes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.scene { background: var(--paper-2); border: 1px solid var(--paper-line); padding: 32px 28px 36px; border-top: 3px solid var(--gold); border-radius: var(--radius); overflow: hidden; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.badge.live::before { background: var(--quiet); }
.badge.wip::before { background: var(--gold-hi); }
.scene h3 { margin-top: 14px; font-size: 22px; }
.scene p:not(.badge) { margin-top: 14px; color: #3c4656; font-size: 15px; }

/* Specs */
.specs { margin-top: clamp(40px, 6vw, 64px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--paper-line); border: 1px solid var(--paper-line); border-radius: var(--radius); overflow: hidden; }
.specs > div { background: var(--paper-2); padding: 22px 24px; }
.specs span { font: 600 12px/1 var(--mono); letter-spacing: .08em; color: var(--muted); }
.specs p { margin-top: 10px; font-size: 15px; font-weight: 500; }

/* Roadmap */
.road { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--ink-line); border: 1px solid var(--ink-line); border-radius: var(--radius); overflow: hidden; }
.road-col { background: var(--ink-2); padding: 32px 28px 36px; }
.road-k { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; letter-spacing: .08em; }
.road-k::before { content: ""; width: 10px; height: 10px; }
.road-k.live::before { background: var(--quiet); }
.road-k.wip::before { background: var(--gold-hi); }
.road-k.plan::before { border: 1.5px solid var(--ink-muted); }
.road ul { list-style: none; padding: 0; margin: 22px 0 0; }
.road li.none { color: var(--ink-muted); }
.road li { padding: 12px 0; border-top: 1px solid var(--ink-line); font-size: 15px; color: var(--ink-text); }

/* About */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.about .section-lead { margin-bottom: 16px; }
.values { display: grid; gap: 1px; background: var(--paper-line); border: 1px solid var(--paper-line); border-radius: var(--radius); overflow: hidden; }
.values article { background: var(--paper-2); padding: 26px 28px; }
.values h3 { font-size: 18px; }
.values p { margin-top: 8px; font-size: 15px; color: #3c4656; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.contact-list { margin: 36px 0 0; }
.contact-list > div { display: grid; grid-template-columns: 96px 1fr; padding: 14px 0; border-top: 1px solid var(--ink-line); }
.contact-list dt { color: var(--ink-muted); font-size: 14px; }
.contact-list dd { margin: 0; font-size: 15px; }
.contact-list a { text-decoration: none; border-bottom: 1px solid var(--ink-line); }
.form { display: grid; gap: 18px; background: var(--ink-2); border: 1px solid var(--ink-line); padding: clamp(24px, 3vw, 40px); border-radius: var(--radius); overflow: hidden; }
.form label { display: grid; gap: 8px; font-size: 13px; color: var(--ink-muted); letter-spacing: .04em; }
.form input, .form textarea, .form select {
  font: 15px/1.5 var(--font); color: var(--ink-text); background: var(--ink); border: 1px solid var(--ink-line);
  padding: 12px 14px; border-radius: 8px; outline: none; transition: border-color .15s;
}
.form input:focus, .form textarea:focus, .form select:focus { border-color: var(--gold-hi); }
.form textarea { resize: vertical; }
.form .btn { justify-self: start; }
.form-note { font-size: 12px; color: var(--ink-muted); }

/* Footer */
.site-footer { background: var(--ink); color: var(--ink-muted); border-top: 1px solid var(--ink-line); padding: 36px 0 28px; font-size: 13px; }
.site-footer .brand-name { color: var(--ink-text); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-row nav { display: flex; gap: 20px; }
.footer-row nav a { text-decoration: none; }
.footer-row nav a:hover { color: var(--ink-text); }
.footnote { margin-top: 20px; font-size: 12px; opacity: .75; }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* Responsive */
@media (max-width: 1024px) {
  .beliefs { grid-template-columns: repeat(6, 1fr); }
  .beliefs article { grid-column: span 2; }
  .beliefs article:nth-child(n+4) { grid-column: span 3; }
  .scenes { grid-template-columns: repeat(2, 1fr); }
  .bento { grid-template-columns: repeat(2, 1fr); grid-auto-flow: row dense; }
  .span-3 { grid-column: span 2; }
}
@media (max-width: 880px) {
  .nav {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink); border-bottom: 1px solid var(--ink-line); padding: 8px var(--pad) 20px;
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  }
  .nav.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--ink-line); font-size: 16px; }
  .nav a.btn { margin-top: 16px; border: 0; height: 48px; }
  .nav-toggle { display: block; }

  .hero-row { grid-template-columns: 1fr; }
  .hero-visual { height: 480px; max-width: 460px; width: 100%; margin: 0 auto; }
  .br-sm { display: inline; }
  .proof { grid-template-columns: repeat(2, 1fr); }
  .proof > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .proof > div:nth-child(n+3) { border-top: 1px solid var(--ink-line); margin-top: 24px; }


  .scenes, .road, .about, .contact { grid-template-columns: 1fr; }
  .specs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .specs, .beliefs { grid-template-columns: 1fr; }
  .mood-living { aspect-ratio: 16 / 9 !important; }
  .plan-render { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .beliefs article, .beliefs article:nth-child(n+4) { grid-column: auto; }
  .hero-visual { height: 420px; }
  .hero-visual .phone { width: 200px; }
  .contact-list > div { grid-template-columns: 80px 1fr; }
}

/* Privacy */
.prose { max-width: 720px; }
.prose h1 { font-size: clamp(28px, 4vw, 40px); }
.prose h2 { margin-top: 40px; font-size: 20px; }
.prose p { margin-top: 14px; color: #3c4656; }

/* Inner pages */
.page-hero { padding-bottom: clamp(40px, 6vw, 72px); }
.page-hero h1 { font-size: clamp(34px, 4.8vw, 58px); line-height: 1.15; }
.page-hero .section-head { margin-bottom: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.split h2 { font-size: clamp(26px, 3.2vw, 38px); }
.h3-gap { font-size: 20px; }
.small { font-size: 13px; margin-top: 16px; }
.ticks-list { list-style: none; padding: 0; margin: 24px 0 0; }
.ticks-list li { position: relative; padding: 0 0 0 20px; margin: 12px 0; font-size: 15px; color: #3c4656; }
.ticks-list li::before { content: ""; position: absolute; left: 0; top: .85em; width: 9px; height: 2px; background: var(--gold); }
.dark .ticks-list li { color: var(--ink-muted); }
.cmp-wrap { overflow-x: auto; border: 1px solid var(--paper-line); border-radius: var(--radius); background: var(--paper-2); }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.cmp th, .cmp td { text-align: left; vertical-align: top; padding: 14px 18px; border-top: 1px solid var(--paper-line); }
.cmp thead th { border-top: 0; font-size: 15px; color: var(--navy); background: var(--paper-3); }
.cmp tbody th { width: 120px; font-weight: 600; color: var(--muted); font-size: 13px; }
.cmp td { color: #3c4656; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 clamp(32px, 5vw, 56px); display: grid; gap: 1px; background: var(--paper-line); border: 1px solid var(--paper-line); border-radius: var(--radius); overflow: hidden; }
.steps li { counter-increment: step; background: var(--paper-2); padding: 20px 24px 20px 64px; position: relative; font-size: 15px; color: #3c4656; }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 24px; top: 20px; font: 600 13px/1.75 var(--mono); color: var(--gold); }
.steps b { color: var(--navy); }
.notyet { margin-top: 28px; border: 1.5px dashed var(--paper-line); border-radius: var(--radius); padding: 20px 24px; }
.notyet-k { font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.notyet ul { margin: 10px 0 0; padding-left: 18px; font-size: 14px; color: #3c4656; }
.notyet li { margin: 6px 0; }
.notyet a { color: var(--navy); }
.figure-phone { margin: 0; max-width: 300px; justify-self: center; }
.figure-phone figcaption { margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center; }
.beliefs.three { grid-template-columns: repeat(3, 1fr); }
.beliefs.three article { grid-column: auto !important; }
@media (max-width: 880px) {
  .split, .beliefs.three { grid-template-columns: 1fr; }
}
.bento.explore .card { text-decoration: none; color: inherit; }
.bento.explore .card h3 { margin-top: 12px; }
.page-toc { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.page-toc a { text-decoration: none; font-size: 14px; color: var(--ink-text); border: 1px solid var(--ink-line); border-radius: 999px; padding: 6px 14px; }
.page-toc a:hover { border-color: var(--ink-muted); }
.figure-phone .phone.android { padding: 6px; border-radius: 16px; background: #000; }
.figure-phone .phone.android img { border-radius: 10px; }
.wrap.solo > div { max-width: 820px; }
.hero-visual .phone-solo { left: 50%; top: 2%; transform: translateX(-50%); z-index: 2; }
