/* ==========================================================================
   Tiny Custom House — design system
   Architectural palette: deep navy/charcoal, warm white, sage, terracotta
   ========================================================================== */

@import url('https://api.fontshare.com/v2/css?f[]=cabinet-grotesk@800,700,500&f[]=satoshi@400,500,700&display=swap');

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.5rem);

  /* Spacing */
  --space-1: 0.25rem;  --space-2: 0.5rem;  --space-3: 0.75rem;
  --space-4: 1rem;     --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem;     --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem;    --space-20: 5rem;   --space-24: 6rem;
  --space-32: 8rem;

  /* Color */
  --ink:        #10202A;
  --ink-soft:   #1B3340;
  --ink-muted:  #4B6472;
  --line:       #DED8CE;
  --line-soft:  #EBE6DE;
  --surface:    #FBF9F5;
  --surface-2:  #F3EFE8;
  --white:      #FFFFFF;
  --sage:       #7D9182;
  --sage-deep:  #5E7265;
  --accent:     #C4633A;
  --accent-deep:#A8502C;
  --gold:       #C8A24A;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16,32,42,.06), 0 2px 8px rgba(16,32,42,.04);
  --shadow:    0 2px 4px rgba(16,32,42,.05), 0 12px 32px rgba(16,32,42,.08);
  --shadow-lg: 0 8px 24px rgba(16,32,42,.10), 0 32px 64px rgba(16,32,42,.12);

  --font-display: 'Cabinet Grotesk', 'Satoshi', system-ui, sans-serif;
  --font-body:    'Satoshi', system-ui, -apple-system, sans-serif;

  --wrap: 1240px;
  --wrap-narrow: 860px;
  --header-h: 74px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); font-family: var(--font-body); font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }

p { text-wrap: pretty; }
.lead { font-size: var(--text-lg); line-height: 1.5; color: var(--ink-muted); }

::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* ---------- Layout ---------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, var(--wrap-narrow)); margin-inline: auto; }
.section { padding-block: clamp(var(--space-16), 8vw, var(--space-32)); }
.section-sm { padding-block: clamp(var(--space-12), 5vw, var(--space-20)); }
.section-dark { background: var(--ink); color: var(--surface); }
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark .lead { color: rgba(251,249,245,.72); }
.section-alt { background: var(--surface-2); }

.eyebrow {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: var(--space-4);
}
.section-dark .eyebrow { color: var(--gold); }
.sage .eyebrow { color: var(--sage-deep); }

.section-head { max-width: 62ch; margin-bottom: clamp(var(--space-10), 4vw, var(--space-16)); }
.section-head p { margin-top: var(--space-4); font-size: var(--text-lg); color: var(--ink-muted); line-height: 1.5; }
.section-dark .section-head p { color: rgba(251,249,245,.7); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 0.875rem 1.5rem; border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: 700; letter-spacing: .01em;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-soft); }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-ghost-light { border-color: rgba(255,255,255,.45); color: #fff; background: transparent; }
.btn-ghost-light:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn-lg { padding: 1.0625rem 2rem; font-size: var(--text-base); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251,249,245,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: var(--space-6); }
.brand { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; margin-right: auto; }
.brand svg { width: 34px; height: 34px; color: var(--ink); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.0625rem; letter-spacing: -0.02em; white-space: nowrap; }
.brand-sub { font-size: 0.625rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-muted); font-weight: 500; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: var(--space-6); }
.nav a {
  font-size: var(--text-sm); font-weight: 500; color: var(--ink-soft);
  padding-block: var(--space-2); position: relative; white-space: nowrap;
  transition: color .18s var(--ease);
}
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .22s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }

.header-cta { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }
.header-phone { font-size: var(--text-sm); font-weight: 700; white-space: nowrap; }
.header-phone span { display: block; font-size: 0.625rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }

.menu-toggle { display: none; background: none; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .625rem; cursor: pointer; }
.menu-toggle svg { width: 20px; height: 20px; }

@media (max-width: 1100px) {
  .nav { display: none; }
  .menu-toggle { display: block; }
  .header-phone { display: none; }
}
@media (max-width: 560px) { .header-cta .btn { display: none; } }

.mobile-nav {
  display: none; position: fixed; inset: var(--header-h) 0 0; z-index: 99;
  background: var(--surface); padding: var(--space-8) 1.25rem; overflow-y: auto;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block; padding: var(--space-4) 0; font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700; border-bottom: 1px solid var(--line-soft);
}
.mobile-nav .btn { margin-top: var(--space-8); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(251,249,245,.72); padding-block: var(--space-20) var(--space-8); font-size: var(--text-sm); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--space-10); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-family: var(--font-body); font-size: var(--text-xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: var(--space-4); }
.site-footer a { color: rgba(251,249,245,.72); transition: color .18s var(--ease); }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: var(--space-3); }
.footer-brand svg { width: 40px; height: 40px; color: #fff; margin-bottom: var(--space-4); }
.footer-brand p { max-width: 34ch; line-height: 1.6; }
.footer-bottom { margin-top: var(--space-16); padding-top: var(--space-6); border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; font-size: var(--text-xs); color: rgba(251,249,245,.5); }

/* ---------- Cards / shared components ---------- */
.card {
  background: var(--white); border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line); }

.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.badge {
  display: inline-block; padding: .3125rem .625rem; border-radius: 100px;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.badge-accent { background: var(--accent); color: #fff; }
.badge-sage  { background: var(--sage); color: #fff; }
.badge-ink   { background: var(--ink); color: #fff; }
.badge-line  { background: var(--surface-2); color: var(--ink-muted); border: 1px solid var(--line); }

.ratio { position: relative; overflow: hidden; background: var(--surface-2); }
.ratio > img, .ratio > video, .ratio > iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ratio-4-3 { aspect-ratio: 4/3; }
.ratio-3-2 { aspect-ratio: 3/2; }
.ratio-1-1 { aspect-ratio: 1/1; }
.ratio-16-9 { aspect-ratio: 16/9; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Forms ---------- */
.field { display: grid; gap: var(--space-2); }
.field label { font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: .8125rem 1rem; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: var(--white); font-size: var(--text-base);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(196,99,58,.14);
}
.field textarea { min-height: 120px; resize: vertical; }
.field-note { font-size: var(--text-xs); color: var(--ink-muted); text-transform: none; letter-spacing: 0; font-weight: 400; }

.disclaimer {
  font-size: var(--text-xs); color: var(--ink-muted); line-height: 1.55;
  border-left: 2px solid var(--line); padding-left: var(--space-4);
}
.section-dark .disclaimer { color: rgba(251,249,245,.55); border-color: rgba(255,255,255,.2); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: var(--space-4); top: var(--space-4); z-index: 999; background: var(--ink); color: #fff; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); }
