/* Layout: single column, generous intro, one project widget split into "about" and a live mini calculator */
:root {
  --bg: #F4F3EF; --surface: #FFFFFF; --ink: #15201B; --muted: #5E6A63; --line: #DAD9D2;
  --accent: #0B7356; --accent-soft: #D7ECE3; --accent-ink: #FFFFFF; --bad: #B83A2E;
  --f-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111613; --surface: #18201C; --ink: #E4ECE7; --muted: #94A49B; --line: #2A3530;
    --accent: #3BC495; --accent-soft: #163A2D; --accent-ink: #08130F; --bad: #EE6B5E; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111613; --surface: #18201C; --ink: #E4ECE7; --muted: #94A49B; --line: #2A3530;
  --accent: #3BC495; --accent-soft: #163A2D; --accent-ink: #08130F; --bad: #EE6B5E; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--f-body); padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
a { color: inherit; }
a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; text-wrap: balance; letter-spacing: -0.02em; }
p { margin: 0; }

.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

.top { display: flex; align-items: center; justify-content: space-between; padding-block: 28px; }
.word { font-family: var(--f-mono); font-weight: 500; font-size: 1.05rem; text-decoration: none; }
.word .slash { color: var(--accent); margin-right: 2px; }
.top nav a { font-size: .9rem; color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ink); }

.intro { padding-block: clamp(40px, 9vw, 110px) clamp(40px, 7vw, 80px); display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.eyebrow { font-family: var(--f-mono); font-size: .8rem; color: var(--accent); letter-spacing: .04em; }
h1 { font-size: clamp(2.4rem, 7vw, 4.6rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.035em; }
.lede { font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--muted); max-width: 56ch; }

.projects { display: flex; flex-direction: column; gap: 20px; padding-bottom: 80px; }
.sechead { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.sechead h2 { font-size: 1rem; font-weight: 700; letter-spacing: 0; }
.count { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); }

.widget { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.about { padding: clamp(22px, 4vw, 40px); display: flex; flex-direction: column; gap: 16px; }
.badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 99px; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.about h3 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; }
.about > p { color: var(--muted); max-width: 52ch; }
.feats { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: .94rem; }
.feats li { padding-left: 22px; position: relative; }
.feats li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 10px; height: 2px; background: var(--accent); }
.cta { align-self: flex-start; margin-top: 6px; display: inline-flex; gap: 8px; align-items: center; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; padding: 12px 18px; border-radius: 10px; transition: transform .15s; }
.cta:hover { transform: translateY(-1px); }
.cta span { transition: transform .15s; }
.cta:hover span { transform: translateX(3px); }
.url { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); }

.calc { background: var(--accent-soft); padding: clamp(22px, 4vw, 40px); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.calc h4 { font-size: 1.05rem; font-weight: 700; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields label { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; font-weight: 500; color: var(--muted); }
.fields .wide { grid-column: 1 / -1; }
.box { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.box:focus-within { border-color: var(--accent); }
.box input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 500 1rem var(--f-mono); padding: 9px 10px; outline: none; }
.box em { font-style: normal; color: var(--muted); padding: 0 10px; font-size: .85rem; }
.box input[aria-invalid="true"] { color: var(--bad); }
.result { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.result .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.result .k b { font-weight: 600; }
.result .v { font: 500 clamp(1.4rem, 3.4vw, 1.9rem) var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.result .s { font-size: .8rem; color: var(--muted); }
.spark { width: 100%; height: 70px; display: block; }
.spark .area { fill: var(--accent); opacity: .18; }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark .end { fill: var(--accent); }
.err { font-size: .85rem; color: var(--bad); }
.fine { font-size: .76rem; color: var(--muted); line-height: 1.5; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-block: 24px 40px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }

@media (max-width: 760px) {
  .widget { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
