/* Home: charcoal Lake District sketchbook + soft-skeuomorphic bento */

body.home {
  --paper: #f4efe4;
  --paper-deep: #e6dccb;
  --graphite: #2a2722;
  --tile-r: 28px;
  --tile-pad: 20px;
  --home-max: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  background: #1c1a16;
  background-image: none;
  color: var(--ink);
}

body.home img { outline: none; }

body.home #navbar {
  background: color-mix(in srgb, #f6f1e6 95%, transparent);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.72) inset,
    0 10px 28px rgba(16, 12, 8, 0.22);
  color: var(--ink);
}

body.home .logo,
body.home .nav-links a {
  color: #161513;
}

body.home .logo small,
body.home .nav-clock {
  color: #3a3834;
}

body.home .nav-sub {
  background: #fffdf8;
}
body.home .nav-sub a:hover,
body.home .nav-sub a:focus-visible {
  background: #f4efe4;
  color: #161513;
}

body.home footer {
  position: relative;
  z-index: 4;
  background: #e8e0d0;
  box-shadow: 0 -16px 48px rgba(8, 6, 4, 0.28);
}

/* Fixed charcoal world */
.sketch-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: #1c1a16;
}

.sketch-layer {
  position: absolute;
  inset: -8%;
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.06);
  will-change: opacity, transform;
  transition: opacity 0.7s var(--ease);
}

.sketch-layer.is-on { opacity: 1; }

.sketch-layer[data-scene="hero"] {
  background-image: url("/images/sketch-hero-800.webp?v=3");
  background-position: 82% 78%;
}
@media (min-width: 901px) {
  .sketch-layer[data-scene="hero"] {
    background-image: url("/images/sketch-hero.webp?v=3");
  }
}

.sketch-layer[data-scene="valley"] { background-position: 22% 72%; }
.sketch-layer[data-scene="town"] { background-position: 78% 70%; }
.sketch-layer[data-scene="dusk"] { background-position: 58% 75%; }

.sketch-mist {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 70% 110%, rgba(12, 10, 8, 0.15), transparent 55%),
    linear-gradient(180deg, rgba(20, 18, 14, 0.22) 0%, transparent 18%, transparent 78%, rgba(16, 14, 12, 0.22) 100%);
}

.sketch-grain {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

body.home main {
  position: relative;
  z-index: 1;
}

.scroll-lead {
  position: fixed;
  top: var(--nav-h);
  left: 10px;
  bottom: 24px;
  z-index: 6;
  width: 2px;
  background: rgba(244, 239, 228, 0.18);
  border-radius: 2px;
  pointer-events: none;
}

.scroll-lead span {
  display: block;
  width: 100%;
  height: 100%;
  background: #f4efe4;
  transform-origin: top center;
  transform: scaleY(0);
  box-shadow: 0 0 8px rgba(244, 239, 228, 0.35);
}

/* Hero: landscape is the picture; plaque sits on it */
.hero-stage {
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--nav-h) + 12px) var(--gutter) 0;
  position: relative;
}

.hero-plaque {
  z-index: 3;
  margin-bottom: clamp(64px, 14vh, 140px);
  max-width: 520px;
}

.sketch-caption {
  position: absolute;
  left: var(--gutter);
  bottom: 28px;
  z-index: 3;
  font-family: Caveat, cursive;
  font-size: clamp(20px, 2.4vw, 28px);
  color: rgba(244, 239, 228, 0.82);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  letter-spacing: 0.02em;
}

/* Soft-skeuomorphic tiles */
.tile {
  --inner-r: 8px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: var(--tile-pad);
  border-radius: var(--tile-r);
  color: var(--ink);
  background-color: #f6f1e6;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 38%),
    radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, 0.35), transparent 50%);
  border: 1px solid rgba(52, 46, 36, 0.16);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.82) inset,
    0 -1px 0 rgba(48, 40, 30, 0.06) inset,
    0 1px 2px rgba(48, 40, 30, 0.06),
    0 14px 32px rgba(16, 12, 8, 0.28);
  transform: translateY(18px);
  opacity: 0;
  filter: blur(5px);
  transition-property: transform, box-shadow, opacity, filter, border-color;
  transition-duration: 0.55s, 0.2s, 0.55s, 0.55s, 0.2s;
  transition-timing-function: var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.tile.is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

a.tile {
  text-decoration: none;
}

a.tile:hover,
a.tile:focus-visible {
  transform: translateY(-3px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 18px 36px rgba(16, 12, 8, 0.34);
}

a.tile:active {
  transform: translateY(1px) scale(0.99);
  box-shadow:
    inset 0 2px 8px rgba(48, 40, 30, 0.16),
    0 6px 16px rgba(16, 12, 8, 0.2);
}

.tile.ink {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 32%),
    #2c2924;
  color: #f4efe4;
  border-color: rgba(0, 0, 0, 0.4);
}

.tile.ink .lede,
.tile.ink p { color: #c9c2b4; }
.tile.ink .kicker { color: #e0a070; }
.tile.ink .meta { color: #e8b48a; }
.tile.ink a { color: inherit; }

.tile-tape::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 22px;
  width: 78px;
  height: 20px;
  background: rgba(232, 214, 160, 0.58);
  transform: rotate(-7deg);
  border-radius: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

.hero-place {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lake);
  margin-bottom: 10px;
}

.hero-plaque .display {
  font-size: clamp(32px, 4.6vw, 52px);
}

.hero-plaque .lede {
  font-size: 16px;
  margin-top: 12px;
}

body.home .kicker {
  color: var(--lake);
}

.tile .num {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: var(--inner-r);
  background: #efe6d4;
  box-shadow:
    inset 0 1px 2px rgba(40, 36, 30, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.7);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--copper);
}

.tile:has(.tile-icon) {
  padding-right: 78px;
}

.tile-icon {
  --icon-r: 14px;
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 48px;
  height: 48px;
  margin: 0;
  display: grid;
  place-items: center;
  border-radius: var(--icon-r);
  color: #2a2722;
  background:
    radial-gradient(circle at 32% 24%, #fffdf6 0%, #f0e4cc 38%, #c9b48e 78%, #a8926c 100%);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.9),
    inset 0 -4px 7px rgba(72, 52, 32, 0.28),
    inset 3px 4px 6px rgba(255, 255, 255, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.45),
    0 8px 14px rgba(16, 12, 8, 0.22),
    0 2px 4px rgba(16, 12, 8, 0.16);
  transition: transform 180ms var(--ease);
}

.tile-icon::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 6px;
  width: 18px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  filter: blur(1.5px);
  pointer-events: none;
  z-index: 0;
}

.tile-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: repeating-linear-gradient(
    -28deg,
    transparent 0 2px,
    rgba(48, 40, 30, 0.07) 2px 3px
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.tile-icon svg {
  width: 28px;
  height: 28px;
  display: block;
  position: relative;
  z-index: 1;
  filter:
    drop-shadow(0 1px 0 rgba(255, 248, 236, 0.75))
    drop-shadow(0.6px 1.6px 1.4px rgba(48, 28, 12, 0.5));
}

.tile.ink .tile-icon {
  color: #f4efe4;
  background:
    radial-gradient(circle at 32% 24%, #6a6560 0%, #3a3632 48%, #1c1a16 100%);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.18),
    inset 0 -5px 8px rgba(0, 0, 0, 0.5),
    0 8px 14px rgba(0, 0, 0, 0.28);
}

.tile.ink .tile-icon::before {
  background: rgba(255, 255, 255, 0.22);
}

.tile.ink .tile-icon::after {
  background: repeating-linear-gradient(
    -28deg,
    transparent 0 2px,
    rgba(0, 0, 0, 0.18) 2px 3px
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tile.ink .tile-icon svg {
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.12))
    drop-shadow(0.6px 1.6px 1.6px rgba(0, 0, 0, 0.7));
}

a.tile:hover .tile-icon {
  transform: translateY(-1px);
}

.tile h2,
.tile h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(22px, 2.2vw, 28px);
  margin: 10px 0 8px;
  text-wrap: balance;
  letter-spacing: -0.02em;
}

.tile p {
  color: var(--muted);
  font-size: 15px;
  text-wrap: pretty;
  flex: 1;
}

.tile .meta {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--lake);
}

/* Raised pressable buttons — same stamped plate as icons */
body.home .btn.press {
  color: #4a4034;
  text-shadow:
    0 -1px 0 rgba(32, 22, 12, 0.55),
    0 1px 0 rgba(255, 252, 245, 1),
    0 0 0.5px rgba(40, 28, 16, 0.35);
  background:
    radial-gradient(120% 140% at 32% 18%, #fffdf7 0%, #efe4cc 48%, #d2c0a0 100%);
  border: 0;
  border-radius: 14px;
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.9),
    inset 0 -3px 6px rgba(72, 52, 32, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.4),
    0 3px 0 #c4b496,
    0 8px 14px rgba(16, 12, 8, 0.22);
}

body.home .btn.press:hover {
  color: #4a4034;
  background:
    radial-gradient(120% 140% at 32% 18%, #fff 0%, #f3e8d2 48%, #d8c6a6 100%);
  border: 0;
  filter: none;
}

body.home .btn.press:active {
  transform: translateY(2px) scale(1);
  text-shadow:
    0 1px 0 rgba(255, 252, 245, 0.2),
    0 1px 2px rgba(32, 22, 12, 0.45);
  box-shadow:
    inset 0 3px 8px rgba(40, 32, 22, 0.34),
    inset 0 -1px 1px rgba(255, 255, 255, 0.22),
    0 1px 0 #c4b496;
}

body.home .btn.ghost.press {
  background: linear-gradient(#fffaf0, #eadfc8);
  color: #4a4034;
  text-shadow:
    0 -1px 0 rgba(32, 22, 12, 0.45),
    0 1px 0 rgba(255, 252, 245, 1);
  border: 0;
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -2px 4px rgba(72, 52, 32, 0.12),
    0 2px 0 #c9c0ae,
    0 6px 12px rgba(40, 36, 30, 0.12);
}

body.home .btn.ghost.press:hover {
  background: linear-gradient(#fff, #e4d8c0);
  color: #4a4034;
}

body.home .tile.ink .btn.press {
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.9),
    inset 0 -3px 6px rgba(72, 52, 32, 0.22),
    0 3px 0 #8a7c64,
    0 10px 18px rgba(0, 0, 0, 0.35);
}

/* Bento */
.bento-wrap {
  position: relative;
  z-index: 2;
  padding: 8px var(--gutter) 72px;
}

.bento {
  width: min(var(--home-max), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  padding: 10px 0 28px;
  perspective: 1200px;
}

.scene-note {
  grid-column: 1 / -1;
  font-family: Caveat, cursive;
  font-size: clamp(24px, 3vw, 32px);
  color: rgba(244, 239, 228, 0.84);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  margin: 18px 6px 2px;
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.row-2 { grid-row: span 2; }

.tile.offer-board p {
  flex: none;
  max-width: 46rem;
}

.offer-board p + p {
  margin-top: 12px;
}

.offer-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 16px 0 18px;
  max-width: none;
}

.offer-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px 8px 8px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  font-size: 14px;
  line-height: 1.35;
  text-wrap: pretty;
  background: #f3ead8;
  border: 1px solid rgba(52, 46, 36, 0.1);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.72) inset,
    0 1px 2px rgba(48, 40, 30, 0.06);
  transition-property: transform, box-shadow, background-color, border-color;
  transition-duration: 160ms;
  transition-timing-function: var(--ease);
}

.offer-list a:hover,
.offer-list a:focus-visible {
  transform: translateY(-1px);
  background: #fffaf0;
  border-color: rgba(52, 46, 36, 0.16);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 8px 16px rgba(16, 12, 8, 0.12);
}

.offer-list a:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: inset 0 2px 6px rgba(48, 40, 30, 0.14);
}

.offer-list .n {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--copper);
  background: #efe6d4;
  box-shadow:
    inset 0 1px 2px rgba(40, 36, 30, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.7);
}

.work-list {
  display: grid;
  gap: 0;
  margin-top: 8px;
}

.work-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid rgba(48, 40, 30, 0.1);
  font-size: 15px;
}

.work-list a:hover h4 { color: var(--lake); }
.work-list h4 { font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.work-list span { font-size: 12px; color: var(--muted); }

.process-list {
  display: grid;
  gap: 0;
  margin-top: 4px;
  list-style: none;
  padding: 0;
}

.process-list li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(48, 40, 30, 0.1);
  font-size: 15px;
  color: var(--muted);
}

.process-list strong {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--copper);
  padding-top: 2px;
}

.place-clock {
  font-family: var(--font-mono);
  font-size: clamp(22px, 3vw, 28px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  margin: 8px 0 12px;
}

.pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0d9a8, #c4a056 55%, #6a4a22);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.tile.contact h2 {
  font-family: var(--font-head);
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.05;
}

@media (max-width: 980px) {
  .hero-stage {
    min-height: 100svh;
    padding-bottom: 0;
  }

  .hero-plaque {
    margin-bottom: clamp(72px, 16vh, 120px);
    max-width: none;
  }

  .sketch-caption { left: 16px; bottom: 12px; }

  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 {
    grid-column: span 12;
  }

  .row-2 { grid-row: auto; }

  .offer-list { grid-template-columns: 1fr; }

  .scroll-lead { display: none; }
}

@media (max-width: 640px) {
  .bento { gap: 12px; }
  .tile { border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile,
  .tile.is-in,
  a.tile:hover,
  a.tile:active {
    transform: none;
    filter: none;
    opacity: 1;
    transition: border-color 0.15s, box-shadow 0.15s;
  }

  .sketch-layer,
  .scroll-lead span {
    transform: none !important;
    transition: none;
  }

  .sketch-layer { opacity: 0; }
  .sketch-layer.is-on { opacity: 1; }

}

/* About: stop-scroll charcoal + worded timeline */
body.about .era {
  position: relative;
  min-height: 0;
  display: flex;
  align-items: center;
  padding: clamp(12px, 2.4vh, 24px) var(--gutter);
}

body.about .era-hero {
  min-height: 0;
  align-items: flex-end;
  padding-top: calc(var(--nav-h) + 28px);
  padding-bottom: clamp(16px, 3vh, 28px);
}

body.about .era .sketch-caption {
  position: absolute;
  left: var(--gutter);
  top: calc(var(--nav-h) + 18px);
  bottom: auto;
}

body.about .era-plaque {
  z-index: 3;
  width: min(34rem, 100%);
  max-width: 540px;
  padding: 16px 18px;
}

body.about .era-right {
  justify-content: flex-end;
}

body.about .era-right .sketch-caption { left: auto; right: var(--gutter); }

body.about .era-plaque .display {
  font-size: clamp(26px, 3.8vw, 42px);
  margin: 4px 0 8px;
}

body.about .era-plaque .kicker {
  margin-bottom: 0;
}

body.about .era-plaque h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin: 0 0 12px;
}

body.about .era-plaque p {
  margin-top: 10px;
}

body.about .era-plaque .lede {
  font-size: 16px;
  margin-top: 12px;
}

body.about .era-end {
  margin-top: 18px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.35;
  color: inherit;
  text-wrap: pretty;
}

body.about .era-close {
  padding-bottom: 64px;
}

body.about .sketch-layer {
  inset: -3%;
  background-position: 50% 36%;
  transition: opacity 1.15s ease;
  background-image: none;
}
body.about .sketch-layer[data-scene="spectrum"] {
  background-image: url("/images/about/spectrum-800.webp?v=5");
  background-position: 72% 28%;
}
@media (min-width: 901px) {
  body.about .sketch-layer[data-scene="spectrum"] {
    background-image: url("/images/about/spectrum.webp?v=5");
  }
}
body.about .sketch-layer[data-scene="it"] { background-position: 16% 30%; }
body.about .sketch-layer[data-scene="gov"] { background-position: 50% 32%; }
body.about .sketch-layer[data-scene="print"] { background-position: 46% 34%; }
body.about .sketch-layer[data-scene="cars"] { background-position: 22% 30%; }
body.about .sketch-layer[data-scene="unit"] { background-position: 58% 34%; }
body.about .sketch-layer[data-scene="ai"] { background-position: 16% 30%; }

@media (max-width: 980px) {
  body.about .era {
    align-items: flex-end;
    min-height: 0;
    padding: 12px 16px 14px;
  }

  body.about .era-hero {
    min-height: 0;
    padding-top: calc(var(--nav-h) + 20px);
  }

  body.about .era-plaque {
    max-width: none;
    width: 100%;
  }

  body.about .era-right { justify-content: flex-end; }
  body.about .era-right .sketch-caption { left: 16px; right: auto; }
}
