/* =========================================================
   Casselman Electric — the smart-home site.

   2026-09-27: page discipline borrowed from tesla.com/home-charging.
   Every idea gets a full-height panel. Text sits centred, headline
   at the top with one line beneath it, actions pinned to the bottom.
   Buttons are the Tesla system: 40px tall, 4px radius, 2px border,
   14px medium, a fixed generous width, outline or solid. Photographs
   get the whole screen. Small quiet grids instead of ruled lists.

   What stays ours: charcoal ground, warm light only from photographs,
   Cormorant Garamond for headlines, no accent colour, nothing flashing.
   ========================================================= */

:root {
  --ink:     #111111;
  --ink-2:   #171717;
  --paper:   #ece8e1;
  --paper-2: #b9b4ac;
  --mute:    #7d7973;
  --line:    rgba(236, 232, 225, .14);
  --line-2:  rgba(236, 232, 225, .34);

  --font:  "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;

  --wrap: 1320px;
  --gut: clamp(20px, 4vw, 48px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ink); color: var(--paper);
  font-family: var(--font); font-weight: 400; font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--paper); outline-offset: 4px; }
.hide { position: absolute; left: -9999px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: var(--gut); padding-right: var(--gut); }

/* ---------- type: modest sizes, centred, lots of air ---------- */
h1, h2 {
  font-family: var(--serif); font-weight: 300; letter-spacing: -.01em; line-height: 1.02;
  text-align: center; text-wrap: balance; margin-left: auto; margin-right: auto;
}
h1 { font-size: clamp(42px, 5.6vw, 76px); max-width: 16ch; }
h2 { font-size: clamp(36px, 4.4vw, 60px); max-width: 18ch; }
h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 1.8vw, 26px); line-height: 1.15; }
.sub {
  font-size: clamp(15px, 1.1vw, 17px); line-height: 1.55; color: var(--paper-2);
  text-align: center; max-width: 60ch; margin: 16px auto 0;
}
.prose {
  font-family: var(--serif); font-weight: 400; font-size: clamp(21px, 1.9vw, 27px); line-height: 1.42;
  text-align: center; max-width: 42ch; margin: 22px auto 0;
}
.manifesto {
  font-family: var(--serif); font-weight: 300; font-size: clamp(26px, 2.8vw, 40px); line-height: 1.2;
  text-align: center; max-width: 34ch; margin: 0 auto;
}
.about {
  font-family: var(--serif); font-weight: 300; font-size: clamp(19px, 1.6vw, 24px); line-height: 1.35;
  text-align: center; max-width: 52ch; margin: 0 auto; color: var(--paper-2);
}

/* ---------- buttons: the Tesla system ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; min-width: 264px; padding: 0 24px;
  border: 2px solid transparent; border-radius: 4px;
  font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background-color .33s var(--ease), color .33s var(--ease), border-color .33s var(--ease);
}
.btn-line { border-color: var(--line-2); color: var(--paper); background: transparent; }
.btn-line:hover { border-color: var(--paper); }
.btn-solid { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-solid:hover { background: #fff; border-color: #fff; }
.btn-onimage { background: rgba(236, 232, 225, .92); color: var(--ink); border-color: transparent; }
.btn-onimage:hover { background: #fff; }
.btn-onimage-line { background: rgba(17, 17, 17, .32); color: #fff; border-color: rgba(255, 255, 255, .55); backdrop-filter: blur(6px); }
.btn-onimage-line:hover { background: rgba(17, 17, 17, .5); border-color: #fff; }
.btn-sm { height: 34px; min-width: 0; padding: 0 16px; font-size: 13px; border-color: var(--line-2); }
.btn-sm:hover { border-color: var(--paper); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px; }
@media (max-width: 560px) { .btn { min-width: 0; width: 100%; max-width: 360px; } }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; padding-top: env(safe-area-inset-top, 0px);
  transition: background-color .45s var(--ease);
}
.nav.solid { background: rgba(17, 17, 17, .82); backdrop-filter: blur(14px); }
.nav-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 60px; }
.mark { font-size: 15px; font-weight: 300; letter-spacing: -.01em; white-space: nowrap; }
.mark b { font-weight: 500; }
.nav-links { display: flex; gap: 6px; justify-content: center; }
.nav-links a { padding: 8px 12px; border-radius: 4px; font-size: 14px; font-weight: 500; color: var(--paper); white-space: nowrap; transition: background-color .3s var(--ease); }
.nav-links a:hover { background: rgba(236, 232, 225, .12); }
.nav-cta { justify-self: end; }
@media (max-width: 900px) {
  .nav-in { grid-template-columns: 1fr auto; }
  .nav-links { display: none; }
}
@media (max-width: 560px) { .nav-cta { display: none; } }

/* ---------- panels: one idea per screen ---------- */
.panel {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  padding: 112px var(--gut) clamp(40px, 6vh, 64px);
  overflow: hidden;
}
.panel.centre { justify-content: center; gap: clamp(36px, 6vh, 64px); }
.panel-top { width: 100%; max-width: 1100px; margin: 0 auto; }
.panel-bottom { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.col { width: 100%; max-width: 900px; margin: 0 auto; }
.bleed { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scrim { position: absolute; inset: 0; pointer-events: none; }
.scrim-hero { background: linear-gradient(to bottom, rgba(13,12,11,.55) 0%, rgba(13,12,11,.18) 30%, rgba(13,12,11,.12) 60%, rgba(13,12,11,.62) 100%); }
.scrim-scene { background: linear-gradient(to bottom, rgba(13,12,11,.5) 0%, rgba(13,12,11,0) 32%, rgba(13,12,11,0) 70%, rgba(13,12,11,.55) 100%); }
.scrim-close { background: linear-gradient(to bottom, rgba(17,17,17,.9) 0%, rgba(17,17,17,.55) 35%, rgba(17,17,17,.6) 70%, rgba(17,17,17,.94) 100%); }
.panel > .panel-top, .panel > .panel-bottom, .panel > .col, .panel > .grid, .panel > .tiles, .panel > .lead { position: relative; z-index: 2; }
.on-image h2, .hero h1 { color: #fff; }
.on-image .sub, .hero .sub { color: rgba(255, 255, 255, .86); }

/* hero */
.hero { background: #0d0c0b; }
.hero .bleed { object-position: 50% 42%; opacity: 0; transform: scale(1.03); animation: hero-in 2s var(--ease) .1s both; }
.hero .panel-top > * { animation: rise 1s var(--ease) both; }
.hero .panel-top > :nth-child(1) { animation-delay: .8s; }
.hero .panel-top > :nth-child(2) { animation-delay: 1s; }
.hero .panel-bottom { animation: rise 1s var(--ease) 1.2s both; }
@keyframes hero-in { to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* badges: three quiet facts, Tesla's hero row */
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px clamp(32px, 6vw, 96px); }
.badges li { text-align: center; color: #fff; }
.badges b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 2vw, 28px); line-height: 1.1; }
.badges span { display: block; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .8); margin-top: 4px; }

/* belief's quiet brand row */
.under { font-size: 15px; color: var(--paper-2); text-align: center; max-width: 44ch; }
.brands { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 44px; }
.brands li { font-size: 17px; color: var(--paper-2); letter-spacing: -.01em; }

/* ---------- reveals ---------- */
.rv { opacity: 0; transform: translateY(16px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.rv.in, .no-rv .rv { opacity: 1; transform: none; }

/* ---------- scene panel ---------- */
.scene { background: #0d0c0b; }
.scene-stage { position: absolute; inset: 0; }
.scene-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s var(--ease); }
.scene-stage img.on { opacity: 1; }
.scene-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 4px; border-radius: 6px; background: rgba(17, 17, 17, .5); backdrop-filter: blur(10px); }
.scene-keys button {
  height: 36px; min-width: 120px; padding: 0 18px; border: 0; border-radius: 4px; background: transparent;
  font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .78); cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.scene-keys button:hover { color: #fff; }
.scene-keys button[aria-pressed="true"] { background: rgba(236, 232, 225, .94); color: var(--ink); }
@media (max-width: 560px) { .scene-keys button { min-width: 0; flex: 1 1 40%; } }

/* ---------- tiles ---------- */
.tiles { width: 100%; max-width: 1100px; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2vw, 28px); }
.tile img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; }
.tile figcaption { text-align: center; margin-top: 14px; font-size: 14px; color: var(--paper-2); }
@media (max-width: 720px) { .tiles { grid-template-columns: 1fr; } .tile img { aspect-ratio: 4 / 3; } }

/* ---------- grids: small, quiet, centred ---------- */
.grid { width: 100%; max-width: 1180px; display: grid; gap: clamp(28px, 4vw, 48px) clamp(24px, 3vw, 40px); text-align: center; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid li { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.grid p { font-size: 14px; line-height: 1.6; color: var(--paper-2); max-width: 32ch; }
.grid small { font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--mute); }
.layers li { padding-top: 22px; border-top: 1px solid var(--line); }
.phases li { padding-top: 22px; border-top: 1px solid var(--line); }
@media (max-width: 1000px) { .grid-5 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } .grid p { max-width: 40ch; } }

/* ---------- closing + form ---------- */
.closing { background: #0b0d10; justify-content: center; gap: clamp(28px, 5vh, 48px); }
.closing .bleed { opacity: .6; object-position: 50% 60%; }
.lead { width: 100%; max-width: 640px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.f { display: flex; flex-direction: column; gap: 6px; }
.f-full { grid-column: 1 / -1; }
label { font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .72); }
input, select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: #fff;
  background: rgba(17, 17, 17, .55); border: 1px solid rgba(255, 255, 255, .22); border-radius: 4px;
  padding: 10px 12px; backdrop-filter: blur(6px); transition: border-color .3s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .45); }
input:focus, select:focus, textarea:focus { border-color: #fff; outline: none; }
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
select { appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,.7) 50%), linear-gradient(135deg, rgba(255,255,255,.7) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.f-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px; margin-top: 8px; }
.f-note { grid-column: 1 / -1; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .8); }
@media (max-width: 560px) { .lead { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.foot { padding: 28px 0 36px; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: 13px; color: var(--mute); text-align: center; }
.foot a:hover { color: var(--paper); }
.foot .fine { width: 100%; font-size: 12px; }

/* ---------- utility pages ---------- */
.simple { min-height: 100svh; display: flex; align-items: center; }
.simple .wrap { display: flex; flex-direction: column; gap: 22px; align-items: center; text-align: center; padding-top: 100px; padding-bottom: 60px; }
.simple .reach { color: var(--paper-2); line-height: 1.7; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero .bleed, .hero .panel-top > *, .hero .panel-bottom { animation: none; opacity: 1; transform: none; }
  .rv { opacity: 1; transform: none; transition: none; }
  .scene-stage img { transition: none; }
}
