/* umbrella site — shared theme. Branding (accent, nav, footer) injected at runtime via /api/site. */
:root {
  color-scheme: light;
/* brand / action */
  --accent: #4f46e5;
  /* filled surfaces (buttons, active nav): holds >=4.5:1 vs #fff */
  --accent-strong: #4f46e5;
  --ok: #15803d;
  --err: #b91c1c;
  --accent-soft: rgba(79, 70, 229, 0.12);
  --bg: #f7f7fa;
  --surface: #ffffff;
  --surface-2: #f1f1f5;
  --text: #1c1c21;
  --muted: #6a6a75;
  --border: #e2e2e8;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root,
  :root.theme-dark { color-scheme: dark; --bg: #121217; --surface: #1b1b22; --surface-2: #232329; --text: #e6e6ea; --muted: #9a9aa5; --border: #2c2c35; --accent-soft: rgba(99, 102, 241, 0.16); --ok: #4ade80; --err: #f87171; }
}
:root.theme-dark { --bg: #121217; --surface: #1b1b22; --surface-2: #232329; --text: #e6e6ea; --muted: #9a9aa5; --border: #2c2c35; --accent-soft: rgba(99, 102, 241, 0.16); --ok: #4ade80; --err: #f87171; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* focus visible — WCAG 2.4.7: every focusable shows a clear indicator */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* prefers-reduced-motion: suppress all motion (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .section-card:hover { transform: none; }
}

/* form controls inherit theme */
input, textarea, select, button { font-family: inherit; }
input[type="color"], input[type="file"] { color-scheme: inherit; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* no top bar: "home" pinned top-right, plain */
.home-link {
  position: fixed; top: 14px; right: 20px; z-index: 10;
  font-size: .95rem; color: var(--muted); font-weight: 400;
  transition: color .15s ease;
}
.home-link:hover, .home-link:focus-visible { color: var(--accent); font-weight: 700; }

main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 3.4rem 20px 60px; }
h1 { font-size: 2rem; margin: 0 0 6px; }
.lede { color: var(--muted); max-width: 60ch; }
section { margin: 26px 0; }
h2 { font-size: 1.4rem; margin: 0 0 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 8px;
}
.card-item figure { margin: -18px -18px 8px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.card-item img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
.card-item h2 { margin: 0; font-size: 1.15rem; }
.card-item h3 { margin: 0; font-size: 1.15rem; }
.card-item .sub { color: var(--muted); margin: 0; }
.card-item .body { color: var(--text); }
.card-item .body h4 { margin: 10px 0 4px; }
.card-item .tags { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .78rem; background: var(--accent-soft); color: var(--accent); padding: 2px 9px; border-radius: 99px; }
.badge { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--border); color: var(--muted); padding: 2px 8px; border-radius: 99px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-block; padding: 6px 14px; border-radius: 9px; font-size: .92rem;
  background: var(--accent-soft); color: var(--accent); border: 1px solid transparent;
}
.btn:hover { text-decoration: none; background: var(--accent-strong); color: #fff; }
.btn.download { background: transparent; border-color: var(--border); color: var(--text); }
.priority { color: #eab308; letter-spacing: 2px; }

/* homepage: big display title + vertical terminal menu, globe to the right */
.home-menu { max-width: 1080px; padding: 3.2rem 16px 0; display: grid; grid-template-columns: 1fr 320px; grid-template-rows: min-content min-content; column-gap: 5rem; align-items: start; }
.home-menu .brand { grid-column: 1 / -1; grid-row: 1; }
.home-menu .menu { grid-column: 1; grid-row: 2; }
.recents { grid-column: 2; grid-row: 2; align-self: start; }
.home-menu .brand {
  font-size: clamp(3.2rem, 11vw, 5.6rem); font-weight: 800; letter-spacing: -0.02em;
  margin: 0 0 3rem; color: var(--text); line-height: 1.1;
}
.home-menu .menu { list-style: none; margin: 0; padding: 0; }
.home-menu .menu li { margin: 0 0 1.5rem; }
.home-menu .menu a {
  display: flex; align-items: baseline; gap: 18px;
  font-size: 1.9rem; font-weight: 400; color: var(--text); text-decoration: none;
  transition: color .15s ease;
}
.home-menu .menu a .prompt { color: var(--muted); width: 1.2ch; flex: none; }
.home-menu .menu a:hover, .home-menu .menu a:focus-visible { color: var(--accent); font-weight: 700; }
.home-menu .menu a:hover .prompt, .home-menu .menu a:focus-visible .prompt { color: var(--accent); font-weight: 700; }
/* hover-only descriptions: hyphenated, smaller, muted */
.home-menu .menu a { position: relative; width: fit-content; }
.home-menu .menu a .desc {
  display: none; position: absolute; left: 100%; top: 50%; transform: translateY(-50%); z-index: 20;
  font-size: .95rem; font-style: italic; font-weight: 400; color: var(--muted);
  white-space: nowrap;
  /* invisible left padding = gap area that still belongs to the link, so
     moving the cursor onto the text keeps :hover alive */
  padding-left: 16px;
}
.home-menu .menu a:hover .desc, .home-menu .menu a:focus-visible .desc { display: block; color: var(--muted); font-weight: 400; }
/* recents box: right side, entries with timestamp + link */
.recents {
  width: 320px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px 10px; background: var(--surface);
}
.recents-head { font-size: .8rem; font-weight: 400; letter-spacing: .1em; color: var(--muted); margin: 0 0 8px; }
.recents-list { list-style: none; margin: 0; padding: 0; }
.recents-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 8px 0; border-top: 1px dashed var(--border);
}
.recents-item a { color: var(--text); font-size: .95rem; transition: color .15s ease; }
.recents-item a:hover, .recents-item a:focus-visible { color: var(--accent); font-weight: 700; }
.recents-item time { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.recents-empty { color: var(--muted); font-size: .9rem; font-style: italic; padding: 6px 0; }
@media (max-width: 900px) { .home-menu { grid-template-columns: 1fr; } .recents { grid-column: 1; grid-row: auto; width: auto; } }

.profile { display: grid; grid-template-columns: 1fr; gap: 22px; }
.profile .card-item { max-width: 640px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--accent-soft); color: var(--accent); padding: 4px 12px; border-radius: 99px; font-size: .9rem; }

form.contact { max-width: 560px; }
form.contact label { display: block; font-size: .85rem; font-weight: 600; margin: 12px 0 4px; }
form.contact input, form.contact textarea {
  width: 100%; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit;
}
form.contact button { margin-top: 14px; }
button {
  font: inherit; padding: 9px 20px; border-radius: 9px; cursor: pointer;
  background: var(--accent-strong); color: #fff; border: 1px solid var(--accent-strong);
}
button:disabled { opacity: .6; cursor: wait; }
.hp-field { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; overflow: hidden; }
.status-msg { margin-top: 12px; color: var(--muted); }
.status-msg.ok { color: var(--ok); }
.status-msg.err { color: var(--err); }

footer.site { border-top: 1px solid var(--border); padding: 18px 20px 30px; text-align: center; color: var(--muted); font-size: .9rem; }
/* projects page: grouped grid + hover info tiles */
.project-group { margin: 26px 0; }
.group-title { font-size: 1.1rem; font-weight: 700; color: var(--muted); text-transform: lowercase; letter-spacing: .08em; margin: 0 0 14px; }
.project-tile .pcover { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; }
.project-tile .pcover img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.project-tile:focus-visible .pinfo { display: block; }
/* hover info variants — only shown while hovering the tile */
.pinfo { display: none; position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px; }
.project-tile:hover .pinfo, .project-tile:focus-visible .pinfo { display: block; }
.pinfo.overlay { background: rgba(10, 10, 14, 0.72); color: #fff; border-radius: 0 0 var(--radius) var(--radius); }
.pinfo.tag { background: rgba(10, 10, 14, 0.82); color: #fff; border-radius: 10px; left: auto; right: 12px; bottom: 12px; max-width: 90%; padding: 6px 12px; font-size: .9rem; }
.pinfo.full { background: rgba(10, 10, 14, 0.62); backdrop-filter: blur(6px); color: #fff; inset: 0; border-radius: var(--radius); display: none; padding: 16px; flex-direction: column; justify-content: flex-end; }
.project-tile:hover .pinfo.full { display: flex; }
.pinfo .ptitle-sm a { color: #fff; font-weight: 700; }
.pinfo .pdesc { color: rgba(255, 255, 255, 0.82); margin: 2px 0 0; font-size: .88rem; }
.project-card h2 a, .ptitle { color: var(--text); }
.project-card h2 a:hover { color: var(--accent); }
.loading { color: var(--muted); padding: 30px 0; }
.empty { color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); padding: 26px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* custom pages: kanban + blocks */
.kb { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 14px 0; }
.kb-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.kb-col-title { font-size: .95rem; font-weight: 700; color: var(--muted); text-transform: lowercase; letter-spacing: .08em; margin: 0 0 10px; }
.kb-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.kb-card { background: var(--surface-2, #f2f2f6); border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; }
.kb-note { color: var(--muted); font-size: .85rem; }
.kb-empty { font-style: italic; font-size: .85rem; list-style: none; padding: 4px 0; }

/* custom-page block additions (builder): divider + quote + project cover / gallery tiles */
hr.divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }
blockquote.quote { margin: 14px 0; padding: 10px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--text); border-radius: 0 var(--radius) var(--radius) 0; }
.project-cover { margin: 0 0 18px; }
.project-cover img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; border-radius: var(--radius); }
.gallery-grid { margin: 0 0 14px; }
.gallery-tile { margin: 0; }
.gallery-tile img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; border-radius: var(--radius); }
.gallery-cap { margin-top: 4px; font-size: .85rem; }

/* split/grid block: two columns, stacks below 640px */
.bgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; margin: 14px 0; }
.bgrid-img { margin: 0; }
.bgrid-img img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); display: block; }
.bgrid-empty { border: 1px dashed var(--border); border-radius: var(--radius); padding: 22px; text-align: center; font-size: .9rem; }
@media (max-width: 640px) { .bgrid { grid-template-columns: 1fr; } }
