/* ============================================================
   Townsite Tech — "powered up"
   built from the logo itself: panel #231f20 becomes the page,
   so the square logo dissolves into the dark and only the
   glow remains.
   ============================================================ */

:root {
  --bg: #231f20;            /* exact logo-panel color  */
  --bg-deep: #1b1819;
  --panel: #2a2527;
  --ink: #f4f1ef;
  --ink-mute: #9d9598;
  --hairline: rgba(255, 255, 255, 0.09);
  --glow: rgba(255, 255, 255, 0.85);

  --font: 'Jost', 'Century Gothic', 'Avenir', 'Helvetica Neue', sans-serif;
  --font-digital: 'Digital', monospace;

  --sp-2xs: 4px;  --sp-xs: 8px;  --sp-s: 12px; --sp-m: 16px;
  --sp-l: 24px;   --sp-xl: 40px; --sp-2xl: 64px; --sp-3xl: 96px;
  --r: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* film grain so the dark never looks flat */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--sp-l);
}

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 54%);
  align-items: center;
  gap: var(--sp-2xl);
  position: relative;
}

.logo-wrap { position: relative; }

/* the breathing halo behind the mark */
.logo-wrap::before {
  content: "";
  position: absolute;
  inset: -6%;
  background: radial-gradient(circle at 50% 46%, rgba(255,255,255,0.14), rgba(255,255,255,0.05) 34%, transparent 62%);
  animation: breathe 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.985); }
  50%      { opacity: 1;    transform: scale(1.02); }
}

.logo-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-copy h1 {
  font-size: clamp(34px, 5.2vw, 64px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: 0.01em;
  margin: 0 0 var(--sp-xl);
}

.statement {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.st-lead,
.st-sub {
  font-size: clamp(19px, 2vw, 25px);
  margin: 0;
}

.st-lead {
  font-weight: 400;
  letter-spacing: 0.02em;
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.25);
  margin-bottom: var(--sp-m);
}

.st-sub {
  color: var(--ink-mute);
}

.side-label {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-mute);
  opacity: 0.7;
}

/* ---------- quote ---------- */

.quote {
  padding: var(--sp-2xl) 0;
  border-top: 1px solid var(--hairline);
  margin-top: var(--sp-xl);
}

.quote p {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  font-size: clamp(17px, 2.2vw, 26px);
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0.005em;
  color: var(--ink-mute);
}

/* ---------- services / bento ---------- */

.services { padding: var(--sp-3xl) 0 var(--sp-2xl); }

.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--sp-l);
}

.tile {
  position: relative;
  display: block;
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  padding: var(--sp-l);
  background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0) 55%);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  overflow: hidden;
}

.tile:hover,
.tile:focus-visible,
.tile:focus-within {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.8),
              inset 0 0 40px rgba(255, 255, 255, 0.03);
  outline: none;
}

.tile.big   { grid-column: span 3; }
.tile.small { grid-column: span 2; }

.tile-head {
  display: flex;
  align-items: center;
  gap: var(--sp-s);
}

.tile h3 {
  margin: 0;
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.tile .icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.35s ease, filter 0.35s ease;
}

.tile:hover .icon,
.tile:focus-within .icon {
  color: #fff;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

/* hidden one-liner: expands open like a curtain on hover/focus */
.tile-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.45s ease, opacity 0.45s ease, margin 0.45s ease;
  margin-top: 0;
}

.tile-body > div { overflow: hidden; }

.tile-body p {
  margin: 0;
  padding-top: var(--sp-xs);
  font-size: 16px;
  font-weight: 300;
  color: var(--ink-mute);
  line-height: 1.45;
}

.tile:hover .tile-body,
.tile:focus-within .tile-body {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: var(--sp-s);
}

/* ---------- contact ---------- */

.contact {
  padding: var(--sp-3xl) 0 var(--sp-2xl);
  text-align: center;
  border-top: 1px solid var(--hairline);
}

.email {
  font-family: var(--font-digital);
  font-size: clamp(20px, 2.6vw, 30px);
  letter-spacing: 0.06em;
  color: var(--ink);
  margin: 0 0 var(--sp-xl);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-s);
  padding: var(--sp-m) var(--sp-xl);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease, transform 0.2s ease;
}

.button .mark {
  width: 22px;
  height: 22px;
  color: #fff;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.7));
  transition: filter 0.35s ease;
}

.button:hover {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 34px rgba(255, 255, 255, 0.18),
              inset 0 0 18px rgba(255, 255, 255, 0.06);
}

.button:active { transform: scale(0.98); }

/* ---------- footer ---------- */

footer {
  padding: var(--sp-2xl) 0 var(--sp-l);
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}

/* touch devices have no hover — keep the curtain open */
@media (hover: none) {
  .tile-body {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: var(--sp-s);
  }
}

/* ---------- reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .logo-wrap::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    align-content: center;
    gap: var(--sp-xl);
    padding-top: var(--sp-2xl);
    min-height: auto;
  }

  .logo-wrap { max-width: 78vw; margin: 0 auto; }
  .side-label { display: none; }

  .tile.big, .tile.small { grid-column: span 6; }

  .quote { margin-top: var(--sp-2xl); padding: var(--sp-2xl) 0; }
  .services { padding: var(--sp-2xl) 0; }
}

/* ---------- fonts ---------- */

@font-face {
  font-family: 'Digital';
  src: url('assets/fonts/digital-7-mono.woff2') format('woff2'),
       url('assets/fonts/digital-7-mono.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
