/* =========================================================
   BUILT IN THE ATTIC — styles
   ---------------------------------------------------------
   1. Colours & settings (tokens)   ← change the look here
   2. Base
   3. Header (logo, nav, language, theme)
   4. Hero + the interactive lamp
   5. Sections: built, philosophy, habits, projects, about
   6. Contact
   7. Skyline + footer
   8. Motion, responsive, 404
   Fonts are self-hosted: see css/fonts.css (loaded before this file).
   ========================================================= */


/* ---------- 1. TOKENS ---------- */
:root {
  /* Paper & ink */
  --paper:      #F7F4EE;   /* page background (warm cream) */
  --paper-2:    #EFEAE0;   /* soft sand panels */
  --paper-3:    #E7E0D3;   /* placeholder cards */
  --field:      #FBF9F5;   /* form fields */
  --line:       #E1D9CB;   /* thin separators */
  --ink:        #22252B;   /* headings, almost black */
  --ink-2:      #45464A;   /* body text */
  --muted:      #6F6A62;   /* small print (AA on cream) */
  --error:      #A8401F;   /* form error text */

  /* Brand colours (taken straight from the logo file) */
  --amber:      #F4BB60;   /* the logo's window / "attic" colour */
  --ochre:      #B8741A;   /* deeper amber for small text & links (readable on cream) */
  --ochre-big:  #D48C26;   /* amber for the big headline word */

  /* Night (footer) */
  --night:      #1C2226;   /* blue-black, not pure black */
  --night-ink:  #EAE5DB;
  --night-muted:#A3A5A5;
  --tree:       #A8A49B;

  /* Illustration + lamp (light theme) */
  --sketch-filter: none;
  --sketch-blend: multiply;
  --sketch-off-opacity: 1;    /* how visible the sketch is with the lamp off */
  --dusk: #5E6675;            /* evening shade laid over the sketch when the lamp is off */
  --dusk-opacity: .3;
  --glow-blend: multiply;
  --glow-strength: .58;       /* lamp light when on */
  --logo-glow-blend: screen;

  /* Type */
  --sans:  "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --hand:  "Kalam", "Bradley Hand", "Segoe Print", cursive;

  /* Layout */
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

/* Dark theme — follows the system unless the visitor picks one.
   The two blocks below must stay identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15181C; --paper-2: #1C2025; --paper-3: #252A30; --field: #121518; --line: #2E343A;
    --ink: #EDE7DC; --ink-2: #C7C1B6; --muted: #9A958D; --error: #F08C72;
    --ochre: #F0B457; --ochre-big: #F0B457;
    --night: #0D1013; --night-ink: #EAE5DB; --night-muted: #8F9192; --tree: #3A4047;
    --sketch-filter: invert(1) sepia(.18) brightness(.92);
    --sketch-blend: screen; --sketch-off-opacity: .5;
    --dusk-opacity: 0;
    --glow-blend: screen; --glow-strength: .38;
    --logo-glow-blend: multiply;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .logo-on-light { display: none; }
  :root:not([data-theme="light"]) .logo-on-dark  { display: block; }
}
:root[data-theme="dark"] {
  --paper: #15181C; --paper-2: #1C2025; --paper-3: #252A30; --field: #121518; --line: #2E343A;
  --ink: #EDE7DC; --ink-2: #C7C1B6; --muted: #9A958D; --error: #F08C72;
  --ochre: #F0B457; --ochre-big: #F0B457;
  --night: #0D1013; --night-ink: #EAE5DB; --night-muted: #8F9192; --tree: #3A4047;
  --sketch-filter: invert(1) sepia(.18) brightness(.92);
  --sketch-blend: screen; --sketch-off-opacity: .5;
  --dusk-opacity: 0;
  --glow-blend: screen; --glow-strength: .38;
  --logo-glow-blend: multiply;
  color-scheme: dark;
}
:root[data-theme="dark"] .logo-on-light { display: none; }
:root[data-theme="dark"] .logo-on-dark  { display: block; }

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 700; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
::selection { background: color-mix(in srgb, var(--amber) 45%, transparent); }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 4px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px;
  text-decoration: none; font-weight: 500;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  font-size: 12px; font-weight: 500; letter-spacing: .28em; text-transform: uppercase;
  color: var(--muted); line-height: 1.4;
}
.dash { width: 36px; height: 3px; background: var(--amber); border-radius: 2px; }

/* Quiet text link with an underline that warms up on hover */
.text-link {
  display: inline-flex; align-items: center; gap: .6em;
  font-weight: 500; color: var(--ink); text-decoration: none;
  padding-block: 6px 8px; position: relative;
}
.text-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--ink); opacity: .5;
  transition: opacity .25s, background-color .25s;
}
.text-link svg { width: 16px; height: 16px; transition: transform .25s ease; }
.text-link:hover::after { opacity: 1; background: var(--ochre); }
.text-link:hover svg { transform: translateX(4px); }

/* Only show JS-powered controls when JavaScript is running */
html:not(.js) .theme-toggle,
html:not(.js) .lamp-btn,
html:not(.js) .lamp-status,
html:not(.js) .lamp-cue,
html:not(.js) .lamp-hotspot,
html:not(.js) .copy-btn { display: none; }

/* ---------- 3. HEADER ---------- */
.site-header { position: relative; z-index: 5; }
.header-row {
  display: flex; align-items: center; gap: clamp(20px, 3vw, 40px);
  padding-block: 22px;
}
.brand { display: block; width: 104px; flex: none; }   /* logo size: change width only */
.brand-logo { position: relative; display: block; }
.brand img { width: 100%; height: auto; }
.logo-on-dark { display: none; }

/* Glow layer over the logo window. Percentages = window centre inside the logo file. */
.window-glow {
  position: absolute; left: 48.4%; top: 30.4%;
  width: 44%; aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(.7);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,187,96,.75) 0%, rgba(244,187,96,.28) 38%, rgba(244,187,96,0) 68%);
  mix-blend-mode: var(--logo-glow-blend);
  opacity: 0; pointer-events: none;
  transition: opacity .9s var(--ease) .15s, transform .9s var(--ease) .15s;
}
.lamp-on .window-glow { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 34px); margin-left: auto; }
.nav a {
  font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: none;
  background: linear-gradient(var(--ochre), var(--ochre)) left bottom / 0 1px no-repeat;
  padding-block: 6px 3px; transition: background-size .3s ease;
}
.nav a:hover { background-size: 100% 1px; }

.header-tools { display: flex; align-items: center; gap: 16px; }

.lang { display: flex; align-items: center; gap: 6px; font-size: 13px; letter-spacing: .08em; }
.lang span { color: var(--line); }
.lang a {
  color: var(--muted); text-decoration: none; font-weight: 500;
  padding: 8px 2px; transition: color .2s;
}
.lang a:hover { color: var(--ochre); }
.lang a[aria-current="true"] { color: var(--ink); font-weight: 700; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 80%, transparent);
  color: var(--ink); display: grid; place-items: center; cursor: pointer;
  transition: border-color .2s;
}
.theme-toggle:hover { border-color: var(--ochre); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
.is-dark .theme-toggle .sun  { display: none; }
.is-dark .theme-toggle .moon { display: block; }

/* ---------- 4. HERO ---------- */
.hero { position: relative; }
.hero .wrap {
  min-height: clamp(480px, 50vw, 660px);
  display: flex; align-items: center;
  padding-block: 16px 64px;
}
.hero-text { max-width: 500px; position: relative; z-index: 2; display: grid; gap: 22px; }
.hero h1 {
  font-size: clamp(2.5rem, 4.4vw, 4rem);
  line-height: 1.03; letter-spacing: -.028em;
  margin-top: 4px;
}
.hero h1 em { font-style: normal; color: var(--ochre-big); }
.hero-lede { font-size: 17px; line-height: 1.65; max-width: 36ch; }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 30px; margin-top: 6px; }

/* The lamp switch */
.lamp-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 4px 4px 4px 0; margin: 0;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--ink-2);
  cursor: pointer;
}
.lamp-btn svg {
  width: 36px; height: 36px; padding: 6px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--ink);
  transition: background-color .5s var(--ease), border-color .5s var(--ease), box-shadow .5s var(--ease);
}
.lamp-btn .bulb { fill: none; transition: fill .4s var(--ease); }
.lamp-btn:hover svg { border-color: var(--ochre); }
.lamp-btn:hover .lamp-label { color: var(--ink); }
.lamp-on .lamp-btn svg {
  border-color: var(--amber);
  background: color-mix(in srgb, var(--amber) 22%, var(--paper));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--amber) 14%, transparent);
}
.lamp-on .lamp-btn .bulb { fill: var(--amber); stroke: var(--amber); }

.lamp-status {
  min-height: 1.6em;                      /* reserves the line: nothing jumps */
  font-family: var(--hand); font-weight: 300; font-size: 18px; color: var(--ink-2);
  opacity: 0; transform: translateY(4px); pointer-events: none;
  transition: opacity .6s var(--ease) .35s, transform .6s var(--ease) .35s;
}
.lamp-status a { text-decoration: none; }
.lamp-status a:hover { color: var(--ochre); }
.lamp-on .lamp-status { opacity: 1; transform: none; pointer-events: auto; }

/* The sketch bleeds off the right edge and fades into the paper */
.hero-art {
  position: absolute; z-index: 1;
  top: -96px;                          /* slides up under the header */
  right: 0;
  width: min(64vw, 940px);
  aspect-ratio: 1 / 0.92;
  overflow: hidden;
  pointer-events: none;                /* only the lamp itself is clickable */
  background: var(--paper);            /* the sketch blends into this */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 26%),
    linear-gradient(to top, transparent 0%, #000 16%),
    linear-gradient(to bottom, transparent 0%, #000 14%);
  -webkit-mask-composite: source-in, source-in;
          mask-image:
    linear-gradient(to right, transparent 0%, #000 26%),
    linear-gradient(to top, transparent 0%, #000 16%),
    linear-gradient(to bottom, transparent 0%, #000 14%);
          mask-composite: intersect;
}

.sketch {
  /* ── LAMP POSITION ─────────────────────────────────────────
     All values are % of the illustration itself (not the screen).
     If you replace the drawing, update these five lines.
     Tip: open the site with #lamp-debug at the end of the address
     to see the clickable area outlined in red. */
  --lamp-hit-left:   56%;   /* clickable area: left edge   */
  --lamp-hit-top:    29%;   /*                 top edge    */
  --lamp-hit-width:  19%;   /*                 width       */
  --lamp-hit-height: 20%;   /*                 height      */
  --lamp-bulb-x:     69.2%; /* the bulb (hint dot + centre of the light) */
  --lamp-bulb-y:     37.4%;
  /* ───────────────────────────────────────────────────────── */

  position: relative;
  transform: translateY(-9%);           /* crops the empty ceiling a little */
  will-change: transform;
}
.sketch img {
  width: 100%; height: auto;
  filter: var(--sketch-filter);
  mix-blend-mode: var(--sketch-blend);
  transition: opacity .9s var(--ease);
}
/* Evening shade (lamp off) */
.sketch::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(60% 50% at var(--lamp-bulb-x) calc(var(--lamp-bulb-y) + 6%), transparent 0%, var(--dusk) 90%);
  mix-blend-mode: multiply; opacity: 0; pointer-events: none;
  transition: opacity .9s var(--ease);
}
/* Warm light from the desk lamp (this is the original glow, now switchable) */
.sketch::after {
  content: ""; position: absolute; z-index: 2;
  left: var(--lamp-bulb-x); top: calc(var(--lamp-bulb-y) + 5.5%);
  width: 42%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--amber) 0%, color-mix(in srgb, var(--amber) 40%, transparent) 30%, transparent 64%);
  opacity: var(--glow-strength);       /* without JavaScript the lamp simply stays on */
  mix-blend-mode: var(--glow-blend);
  pointer-events: none;
  transition: opacity 1.1s var(--ease) .08s;
}
html.js .sketch::before { opacity: var(--dusk-opacity); }
html.js .sketch img     { opacity: var(--sketch-off-opacity); }
html.js .sketch::after  { opacity: 0; }
html.js:not(.lamp-on) .sketch:has(.lamp-hotspot:hover)::after { opacity: calc(var(--glow-strength) * .3); }
html.js.lamp-on .sketch::before { opacity: 0; }
html.js.lamp-on .sketch img     { opacity: 1; }
html.js.lamp-on .sketch::after  { opacity: var(--glow-strength); }

.lamp-hotspot {
  position: absolute; z-index: 3;
  left: var(--lamp-hit-left); top: var(--lamp-hit-top);
  width: var(--lamp-hit-width); height: var(--lamp-hit-height);
  min-width: 48px; min-height: 48px;
  border-radius: 40%;
  cursor: pointer; pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
/* Small hint on the bulb: "this can be switched on" */
.lamp-cue {
  position: absolute; z-index: 3;
  left: var(--lamp-bulb-x); top: var(--lamp-bulb-y);
  width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--amber); pointer-events: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--amber) 55%, transparent);
  animation: cue 2.6s ease-out 1.2s 4;
  transition: opacity .4s;
}
.lamp-on .lamp-cue { opacity: 0; }
@keyframes cue {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--amber) 55%, transparent); }
  70%  { box-shadow: 0 0 0 16px color-mix(in srgb, var(--amber) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--amber) 0%, transparent); }
}
.lamp-debug .lamp-hotspot { outline: 2px dashed red; background: rgba(255,0,0,.08); }

/* ---------- 5. SECTIONS ---------- */
.built { padding-block: clamp(40px, 6vw, 72px); scroll-margin-top: 24px; }
.built .wrap, .about .wrap {
  display: grid; grid-template-columns: minmax(220px, 1fr) 2.7fr; gap: 32px clamp(32px, 5vw, 72px); align-items: start;
}
.built h2, .about h2 { font-size: clamp(1.75rem, 2.6vw, 2.2rem); font-weight: 500; line-height: 1.15; letter-spacing: -.015em; }
.built-head { display: grid; gap: 14px; }
.built-head p { font-size: 15.5px; color: var(--muted); max-width: 34ch; }

/* auto-fit: add a 4th or 5th category and the row rearranges itself */
.kinds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kind {
  display: grid; align-content: start; gap: 8px;
  padding: 2px clamp(18px, 2.4vw, 32px) 8px;
  border-left: 1px solid var(--line);
}
.kind svg {
  width: 38px; height: 38px; color: var(--ink); margin-bottom: 8px;
  transition: transform .35s ease, color .6s var(--ease);
}
.kind:hover svg { transform: translateY(-3px) rotate(-3deg); color: var(--ochre); }
.lamp-on .kind svg { color: var(--ochre); }
.lamp-on .kind:nth-child(2) svg { transition-delay: .12s; }
.lamp-on .kind:nth-child(3) svg { transition-delay: .24s; }
.kind h3 { font-size: 17px; font-weight: 500; }
.kind p { font-size: 14.5px; line-height: 1.55; color: var(--muted); }

.philosophy { padding-block: 8px clamp(24px, 3vw, 32px); }
.philosophy .wrap {
  display: grid; grid-template-columns: 1.15fr auto 1fr; gap: clamp(28px, 5vw, 80px); align-items: center;
}
.card {
  background: var(--paper-2); border-radius: var(--radius);
  padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 44px);
  display: grid; gap: 16px;
}
.card h2 { font-size: clamp(1.85rem, 3vw, 2.4rem); font-weight: 500; line-height: 1.12; letter-spacing: -.02em; margin: 8px 0 4px; }
.card p { font-size: 16.5px; line-height: 1.7; max-width: 52ch; }
.vrule { width: 1px; align-self: stretch; background: var(--line); margin-block: 16px; }
.quote { display: grid; justify-items: center; gap: 22px; text-align: center; margin: 0; }
.quote blockquote {
  margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(2rem, 3.3vw, 2.7rem); line-height: 1.15; color: var(--ink);
  letter-spacing: -.01em; text-wrap: balance;
}

.habits { padding-block: clamp(24px, 3vw, 36px) clamp(32px, 4vw, 48px); }
.habits .wrap { display: grid; grid-template-columns: minmax(200px, 1fr) 3.2fr; gap: 20px 40px; align-items: start; }
.habits-head { display: grid; gap: 8px; }
.habits-head p { font-size: 13.5px; color: var(--muted); line-height: 1.5; max-width: 30ch; }
.habits ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.habits li {
  font-size: 14.5px; color: var(--ink-2); padding-inline: 20px; border-left: 1px solid var(--line);
  line-height: 1.5;
}
.habits li:first-child { border-left: 0; padding-left: 0; }

.projects { padding-block: 0 clamp(32px, 5vw, 56px); scroll-margin-top: 24px; }
.panel {
  background: var(--paper-2); border-radius: calc(var(--radius) + 2px);
  padding: clamp(28px, 4vw, 48px);
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center;
}
.panel h2 { font-size: clamp(1.8rem, 3vw, 2.35rem); font-weight: 500; letter-spacing: -.02em; line-height: 1.12; margin-bottom: 16px; }
.panel p { max-width: 44ch; line-height: 1.7; }
.soon { position: relative; display: flex; align-items: center; justify-content: center; min-height: 170px; gap: 8px; }
.stack { position: relative; width: min(250px, 60%); aspect-ratio: 1.25; }
.stack span {
  position: absolute; inset: 0; border-radius: 12px;
  background: var(--paper-3);
  border: 1px solid color-mix(in srgb, var(--line) 70%, var(--paper-3));
  display: flex; align-items: center; justify-content: center; gap: 18px;
  color: var(--muted);
  transition: transform .5s ease;
}
.stack span:first-child { transform: translate(22%, -3%) rotate(5deg); opacity: .75; }
.stack span:last-child  { transform: rotate(-3deg); box-shadow: 0 1px 2px rgba(40,30,15,.06); }
.panel:hover .stack span:first-child { transform: translate(26%, -5%) rotate(7deg); }
.stack svg { width: 34px; height: 34px; opacity: .55; }
.note {
  position: absolute; right: 0; top: 4px;
  font-family: var(--hand); font-weight: 300; font-size: 21px; line-height: 1.15; color: var(--ink-2);
  transform: rotate(-7deg); text-align: left;
}
.note svg { width: 52px; height: 44px; margin: 6px 0 0 6px; color: var(--ink-2); }

.about { padding-block: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 40px); scroll-margin-top: 24px; }
.about-body { display: grid; gap: 16px; max-width: 62ch; }
.about-body p { line-height: 1.75; }

/* ---------- 6. CONTACT ---------- */
.contact { padding-block: clamp(24px, 4vw, 48px) 0; scroll-margin-top: 24px; }
.contact .wrap {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px clamp(32px, 6vw, 88px); align-items: start;
}
.contact-info { display: grid; gap: 18px; align-content: start; }
.contact-info h2 { font-size: clamp(1.8rem, 3vw, 2.35rem); font-weight: 500; letter-spacing: -.02em; }
.contact-info > p { max-width: 42ch; line-height: 1.7; }
.email-line { display: grid; gap: 6px; margin-top: 8px; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.email {
  font-size: clamp(1.15rem, 1.8vw, 1.35rem); font-weight: 500; color: var(--ink);
  text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(var(--amber), var(--amber)) left 100% / 100% 2px no-repeat;
  padding-bottom: 2px;
}
.email:hover { color: var(--ochre); }
.copy-btn {
  font: inherit; font-size: 12.5px; font-weight: 500; letter-spacing: .02em;
  color: var(--ink-2); background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  transition: border-color .2s, color .2s;
}
.copy-btn:hover { border-color: var(--ochre); color: var(--ink); }
.notebook { width: min(220px, 70%); color: var(--ink-2); opacity: .7; margin-top: 18px; }

.contact-form-wrap {
  background: var(--paper-2); border-radius: var(--radius);
  padding: clamp(24px, 3.5vw, 40px);
  display: grid; gap: 18px;
}
.contact-form-wrap h3 { font-size: 19px; font-weight: 500; }
.contact-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; color: var(--ink); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--field); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; line-height: 1.55; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--ochre);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 28%, transparent);
}
.field :disabled { opacity: .6; cursor: not-allowed; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-note {
  font-size: 14px; line-height: 1.5; color: var(--ink-2);
  padding: 10px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--amber) 14%, var(--paper));
  border-left: 3px solid var(--amber);
}
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.send-btn {
  font: inherit; font-size: 15px; font-weight: 500;
  color: var(--paper); background: var(--ink);
  border: 0; border-radius: 999px; padding: 11px 22px; cursor: pointer;
  transition: background-color .2s, transform .2s;
}
.send-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 85%, var(--ochre)); }
.send-btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.form-privacy { font-size: 13px; color: var(--muted); line-height: 1.45; flex: 1 1 200px; }
.form-status { font-size: 14.5px; min-height: 1.4em; }
.form-status.is-ok { color: var(--ink); }
.form-status.is-error { color: var(--error); }

/* Messages shown after a no-JavaScript form submission (#message-sent / #message-error) */
.form-flash { display: none; font-size: 14.5px; padding: 10px 14px; border-radius: 10px; background: var(--paper); }
.form-flash:target { display: block; }
.form-flash.is-error { color: var(--error); }

/* ---------- 7. SKYLINE + FOOTER ---------- */
.skyline { display: flex; justify-content: flex-end; margin-top: clamp(8px, 2vw, 24px); line-height: 0; }
.nightscape { width: min(430px, 44vw); height: auto; color: var(--night); }
.nightscape .roof { fill: currentColor; }
.nightscape .trees { fill: var(--tree); }
.roof-glow { opacity: .7; transform-origin: 313px 146px; transition: opacity 1s var(--ease) .3s, transform 1s var(--ease) .3s; }
.lamp-on .roof-glow { opacity: 1; transform: scale(1.35); }

.site-footer { background: var(--night); color: var(--night-muted); font-size: 14px; }
.site-footer .wrap {
  display: grid; grid-template-columns: auto 1fr auto; gap: 24px 48px; align-items: center;
  padding-block: 32px;
}
.foot-brand { display: grid; gap: 14px; }
.foot-brand img { width: 88px; height: auto; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 10px 32px; justify-content: center; }
.foot-nav a { color: var(--night-ink); text-decoration: none; opacity: .85; padding-block: 4px; transition: opacity .2s, color .2s; }
.foot-nav a:hover { opacity: 1; color: var(--amber); }
.foot-tag { color: var(--night-ink); text-align: right; }
.foot-tag::before {
  content: ""; display: block; width: 84px; height: 1px; margin: 0 0 14px auto;
  background: color-mix(in srgb, var(--night-ink) 25%, transparent);
}

/* ---------- 8. MOTION ---------- */
/* Gentle reveal — only for sections below the first screen (added by the script) */
.reveal { transition: opacity .8s ease, transform .8s ease; }
.reveal.is-waiting { opacity: .35; transform: translateY(14px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal.is-waiting { opacity: 1; transform: none; }
}

/* ---------- RESPONSIVE: tablet ---------- */
@media (max-width: 960px) {
  .hero .wrap { min-height: 0; padding-block: 16px 0; }
  .hero-text { max-width: 600px; }
  .hero-art {
    position: relative; top: 0; width: 100%;
    margin-top: -28px; aspect-ratio: 1 / .78;
    -webkit-mask-image:
      linear-gradient(to bottom, transparent 0%, #000 20%),
      linear-gradient(to top, transparent 0%, #000 14%);
    -webkit-mask-composite: source-in;
            mask-image:
      linear-gradient(to bottom, transparent 0%, #000 20%),
      linear-gradient(to top, transparent 0%, #000 14%);
  }
  .sketch { transform: translateY(-14%); }

  .built .wrap, .about .wrap { grid-template-columns: 1fr; }
  .built-head p { max-width: 60ch; }
  .philosophy .wrap { grid-template-columns: 1fr; gap: 28px; }
  .vrule { width: 64px; height: 1px; margin: 0 auto; align-self: auto; }
  .habits .wrap { grid-template-columns: 1fr; }
  .habits-head p { max-width: none; }
  .habits ul { grid-template-columns: repeat(2, 1fr); gap: 16px 0; }
  .habits li:nth-child(3) { border-left: 0; padding-left: 0; }
  .panel { grid-template-columns: 1fr; }
  .contact .wrap { grid-template-columns: 1fr; }
  .notebook { display: none; }
  .site-footer .wrap { grid-template-columns: 1fr auto; }
  .foot-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}

/* ---------- RESPONSIVE: phone ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }

  /* Header becomes two rows: logo + controls on top, links underneath */
  .header-row {
    display: grid; grid-template-columns: auto 1fr; align-items: center;
    gap: 14px 12px; padding-block: 14px 0;
  }
  .brand { width: 72px; grid-row: 1; grid-column: 1; }
  .header-tools { grid-row: 1; grid-column: 2; justify-self: end; gap: 10px; }
  .nav {
    grid-row: 2; grid-column: 1 / -1; margin-left: 0; justify-content: flex-start; gap: 26px;
    padding-block: 10px 4px; border-top: 1px solid var(--line);
  }
  .nav a { font-size: 15px; padding-block: 6px; }

  .hero .wrap { padding-top: 22px; }
  .hero-text { gap: 18px; }
  .hero h1 { font-size: clamp(2.3rem, 11vw, 3.1rem); }
  .hero-actions { gap: 10px 24px; }
  .hero-art { margin-top: -6px; aspect-ratio: 1 / 1; }
  .sketch { width: 150%; margin-left: -34%; transform: translateY(-15%); }

  .kinds { grid-template-columns: 1fr; }
  .kind {
    grid-template-columns: 40px 1fr; column-gap: 18px; row-gap: 2px;
    padding: 18px 0; border-left: 0; border-top: 1px solid var(--line);
  }
  .kind:first-child { border-top: 0; padding-top: 4px; }
  .kind svg { grid-row: span 2; margin: 2px 0 0; width: 32px; height: 32px; }

  .habits ul { grid-template-columns: 1fr; gap: 0; }
  .habits li { border-left: 0; padding: 12px 0; border-top: 1px solid var(--line); }
  .habits li:first-child { border-top: 0; padding-top: 0; }

  .soon { min-height: 190px; justify-content: flex-start; }
  .stack { width: 58%; }
  .note { font-size: 19px; }

  .nightscape { width: 80%; }

  .site-footer .wrap { grid-template-columns: 1fr; gap: 26px; padding-block: 36px 40px; }
  .foot-nav { grid-row: auto; gap: 12px 24px; }
  .foot-tag { text-align: left; }
  .foot-tag::before { margin: 0 0 14px 0; }
}

/* Kinds: vertical separators only between items in the same row (desktop) */
@media (min-width: 641px) {
  .kind:first-child { border-left: 0; padding-left: 0; }
}

/* ---------- 404 page ---------- */
.not-found main { display: grid; gap: 40px; padding-block: 40px 80px; }
.not-found .brand { width: 90px; }
.not-found section { display: grid; gap: 10px; }
.not-found h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 500; }
