/* neforus.com shared styles. Monochrome: white in light mode, black in dark mode, over a blurred text background. */
:root {
  --bg: #ffffff;
  --fg: #0c0c0c;
  --muted: #595959;
  --panel: rgba(255, 255, 255, 0.9);
  --line: rgba(0, 0, 0, 0.14);
  --hover: rgba(0, 0, 0, 0.06);
  --btn-bg: #0c0c0c;
  --btn-fg: #ffffff;
  --img: url("/assets/bg-light.jpg");
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ascii: ui-monospace, "Cascadia Mono", Menlo, "Courier New", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --fg: #f2f2f2; --muted: #a6a6a6; --panel: rgba(8, 8, 8, 0.86);
    --line: rgba(255, 255, 255, 0.16); --hover: rgba(255, 255, 255, 0.08);
    --btn-bg: #f2f2f2; --btn-fg: #000000; --img: url("/assets/bg-dark.jpg"); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --fg: #f2f2f2; --muted: #a6a6a6; --panel: rgba(8, 8, 8, 0.86);
  --line: rgba(255, 255, 255, 0.16); --hover: rgba(255, 255, 255, 0.08);
  --btn-bg: #f2f2f2; --btn-fg: #000000; --img: url("/assets/bg-dark.jpg"); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--fg); font: 17px/1.6 var(--sans); background: transparent; }
.nf-bg { position: fixed; inset: 0; z-index: -1; background: var(--bg) var(--img) center / cover no-repeat; }
a { color: inherit; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Top banner: static (scrolls away with the page). */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 32px; padding: 30px 0 34px; }
.brand { font-size: clamp(28px, 3.4vw, 40px); font-weight: 900; letter-spacing: 0.16em; line-height: 1; text-transform: uppercase; color: var(--fg); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin: 0; padding: 0; list-style: none; }
.nav a { display: inline-block; padding: 6px 0; border-bottom: 2px solid transparent; font-size: clamp(15px, 1.22vw, 18px); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: currentColor; }
.modes { display: inline-flex; border: 1px solid var(--line); margin-left: 4px; }
.modes button { font: 600 12px/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; padding: 8px 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.modes button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
@media (max-width: 720px) {
  .top { padding: 22px 0 26px; gap: 14px; }
  .nav { gap: 4px 18px; }
}

/* Page building blocks */
main { padding-bottom: 40px; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 28px; }
.panel + .panel { margin-top: 20px; }
.page-head { background: var(--panel); border: 1px solid var(--line); padding: 34px 28px; margin-bottom: 20px; }
h1 { margin: 0; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.08; font-weight: 900; letter-spacing: 0.02em; }
.lede { margin: 12px 0 0; max-width: 62ch; color: var(--muted); font-size: 18px; }
.label { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font-size: 13px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.label::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.label a { font-size: 12px; letter-spacing: 0.12em; color: var(--muted); text-decoration: none; order: 2; }
.label a:hover { color: var(--fg); text-decoration: underline; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border: 2px solid var(--fg); background: transparent; color: var(--fg); font: 700 14px/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.btn.solid { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* Icon grid, in the spirit of gdcolon.com: one colour, platform and account under each icon, playful hover. */
.soc { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.soc.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.soc a { display: flex; flex-direction: column; align-items: center; height: 100%; padding: 18px 8px 14px; text-align: center; color: var(--fg); text-decoration: none; transition: background 0.15s; }
.soc .i { width: 46px; height: 46px; fill: currentColor; transition: transform 0.22s cubic-bezier(0.3, 1.7, 0.5, 1); }
.soc .m { display: block; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.soc .p { margin-top: 10px; font-size: 15px; font-weight: 700; line-height: 1.25; }
.soc .h { margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.soc a:hover, .soc a:focus-visible { background: var(--hover); }
.soc a:hover .i, .soc a:focus-visible .i { transform: translateY(-3px) scale(1.16) rotate(-7deg); }
.soc a:active .i { transform: scale(0.94); }
.soc.compact .i { width: 38px; height: 38px; }
.soc.compact .p { font-size: 14px; }
.soc.compact .h { font-size: 12px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Optional brand colours, switched on with the "Color icons" button. --cl is tuned for light mode, --cd for dark. */
.icobar { display: flex; justify-content: flex-end; margin: -6px 0 10px; }
.page-head .icobar { justify-content: flex-start; margin: 18px 0 0; }
.ctog { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 700 12px/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.ctog::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: conic-gradient(#ff0000, #f7931a, #ffdd00, #53fc19, #26a5e4, #6364ff, #ff0069, #ff0000); filter: grayscale(1); }
.ctog:hover { color: var(--fg); border-color: var(--fg); }
.ctog[aria-pressed="true"] { color: var(--fg); border-color: var(--fg); }
.ctog[aria-pressed="true"]::before { filter: none; }
:root[data-icons="color"] .soc .i { color: var(--cl, var(--fg)); }
@media (prefers-color-scheme: dark) { :root[data-icons="color"]:not([data-theme="light"]) .soc .i { color: var(--cd, var(--fg)); } }
:root[data-icons="color"][data-theme="dark"] .soc .i { color: var(--cd, var(--fg)); }
@media (max-width: 520px) { .soc { grid-template-columns: repeat(2, minmax(0, 1fr)); } .soc.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .soc .i { transition: none; } .soc a:hover .i, .soc a:focus-visible .i { transform: none; } }

/* Project cards */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 720px) { .projects { grid-template-columns: minmax(0, 1fr); } }
.proj { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border: 1px solid var(--line); color: var(--fg); text-decoration: none; transition: background 0.15s; }
.proj:hover { background: var(--hover); }
.proj img { width: 56px; height: 56px; flex: none; border: 1px solid var(--line); }
.proj b { display: block; font-size: 19px; }
.proj span { display: block; margin-top: 4px; font-size: 15px; color: var(--muted); }
.proj .u { margin-top: 8px; font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: 0.02em; color: var(--fg); }
.proj:hover b { text-decoration: underline; text-underline-offset: 3px; }

/* Home layout: use the width of the screen, two columns on desktop. */
/* Three columns on wide screens: intro and projects, then the blog in the middle, then socials and support. */
.wrap:has(> main > .home) { max-width: 1880px; }
.home { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.33fr) minmax(0, 0.95fr); gap: 20px; align-items: start; }
/* On wide screens the side columns keep a fixed width and the blog in the middle takes the rest. */
@media (min-width: 1600px) { .home { grid-template-columns: 560px minmax(0, 1fr) 380px; } }
@media (min-width: 1900px) { .home { grid-template-columns: 600px minmax(0, 1fr) 400px; } }
.home > div > .panel + .panel { margin-top: 20px; }
.home .mid .empty { padding: 22px 16px; }
@media (max-width: 1440px) {
  .home { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
  .home > .lead { grid-column: 1; grid-row: 1; }
  .home > .mid { grid-column: 1; grid-row: 2; }
  .home > .side { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 920px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .home > .lead, .home > .mid, .home > .side { grid-column: 1; grid-row: auto; }
}
.hero { display: flex; gap: 24px; align-items: center; }
.hero img { width: 112px; height: 112px; flex: none; border: 1px solid var(--line); }
.hero p.big { margin: 0; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.35; font-weight: 700; }
.hero .since { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
@media (max-width: 520px) { .hero { flex-direction: column; align-items: flex-start; } .hero img { width: 88px; height: 88px; } }
.ascii-wrap { max-width: 100%; overflow: hidden; margin-top: 18px; }
.ascii { margin: 0; font-family: var(--ascii); font-size: clamp(7px, 1.25vw, 13px); line-height: 1.1; white-space: pre; color: var(--fg); }
.substack { display: block; width: 100%; height: 320px; border: 1px solid var(--line); background: #ffffff; }

/* Blog */
.posts { margin: 0; padding: 0; list-style: none; }
.posts li { padding: 16px 0; border-top: 1px solid var(--line); }
.posts li:first-child { border-top: 0; padding-top: 0; }
.posts a { font-size: 20px; font-weight: 700; text-decoration: none; }
.posts a:hover { text-decoration: underline; }
.posts time { display: block; font-size: 13px; color: var(--muted); }
.empty { padding: 26px; border: 1px dashed var(--line); text-align: center; color: var(--muted); }

/* About */
.prose { max-width: 70ch; font-size: 18px; }
.prose p { margin: 0 0 18px; }
/* Blog posts use the full width of the panel. */
.h-entry .prose { max-width: none; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0; font-size: 15px; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; color: var(--muted); }

/* Contact form */
.form { display: grid; gap: 16px; max-width: 680px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .form .row { grid-template-columns: 1fr; } }
.form label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.form input, .form select, .form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--sans); letter-spacing: 0; text-transform: none; }
.form textarea { min-height: 180px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--fg); outline: none; }
.note { font-size: 14px; color: var(--muted); }
.mailto { font-family: var(--mono); font-weight: 700; font-size: 16px; word-break: break-all; }

footer.site { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: 20px; padding: 18px 0 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
footer.site a { color: var(--muted); }

/* Text that sits straight on the background (banner, footer, the small line above a panel) gets a soft
   glow in the page colour, so it stays readable over the lightly blurred background in both themes. */
:root { --halo: 0 0 2px var(--bg), 0 0 4px var(--bg), 0 0 8px var(--bg), 0 0 14px var(--bg), 0 0 22px var(--bg); }
.top .brand, .top .nav a, .wrap > footer, .wrap > footer a, .wrap > .kicker, .wrap > .kicker a { text-shadow: var(--halo); }
.wrap > footer, .wrap > footer a { color: var(--fg); font-weight: 600; }
.top .modes { background: var(--bg); }
