/* ============================================================
   Themes — every colour/font comes from these tokens.
   --accent is overridden inline by the accent easter-egg button.
   ============================================================ */
:root,
[data-theme="light"] {
  --bg: #fafaf7;
  --bg-alt: #f0f2ee;
  --card: #ffffff;
  --fg: #16201b;
  --muted: #5b6660;
  --border: #dde2dc;
  --accent: #1f6f4a;
  --accent-ink: #ffffff;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  --nav-bg: rgba(250, 250, 247, 0.82);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b0d0c;
  --bg-alt: #121614;
  --card: #161b18;
  --fg: #eef2ef;
  --muted: #9aa59f;
  --border: #26302b;
  --accent: #34d399;
  --accent-ink: #04140c;
  --shadow: none;
  --nav-bg: rgba(11, 13, 12, 0.8);
  color-scheme: dark;
}

/* Monokai, as in Sublime Text */
[data-theme="sublime"] {
  --bg: #272822;
  --bg-alt: #2d2e27;
  --card: #1e1f1c;
  --fg: #f8f8f2;
  --muted: #a59f85;
  --border: #3e3d32;
  --accent: #a6e22e;
  --accent-ink: #1e1f1c;
  --kw: #f92672;
  --fn: #a6e22e;
  --str: #e6db74;
  --num: #ae81ff;
  --type: #66d9ef;
  --comment: #75715e;
  --font-head: var(--font-mono);
  --radius: 4px;
  --shadow: none;
  --nav-bg: #1e1f1c;
  color-scheme: dark;
}

/* Green-phosphor terminal */
[data-theme="terminal"] {
  --bg: #050805;
  --bg-alt: #050805;
  --card: #050805;
  --fg: #c8f7c5;
  --muted: #6fae6a;
  --border: #1d3a1b;
  --accent: #33ff66;
  --accent-ink: #050805;
  --font-body: var(--font-mono);
  --font-head: var(--font-mono);
  --radius: 0;
  --shadow: none;
  --nav-bg: #0a120a;
  color-scheme: dark;
}

/* ============================================================
   Base
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0; }
p { margin: 0 0 1em; }
strong { color: var(--fg); font-weight: 600; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 760px; }
.center { text-align: center; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 16px; z-index: 100; background: var(--card); padding: 8px 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--fg); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-b { color: var(--accent); }
.nav-links { display: flex; gap: 22px; margin-left: auto; font-size: 0.92rem; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--fg); text-decoration: none; }
.controls { display: flex; align-items: center; gap: 10px; }

.accent-btn {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--card);
  box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0;
  transition: transform 0.2s ease;
}
.accent-btn:hover { transform: scale(1.15) rotate(20deg); }
.accent-btn.pop { animation: pop 0.35s ease; }
@keyframes pop { 50% { transform: scale(1.4); } }

.theme-picker select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-size: 0.88rem; color: var(--fg);
  background: var(--card)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 30px 6px 14px; cursor: pointer;
}
[data-theme="sublime"] .theme-picker select,
[data-theme="terminal"] .theme-picker select { border-radius: var(--radius); font-family: var(--font-mono); }

/* Theme-only chrome, hidden by default */
.editor-tabs, .term-bar { display: none; }

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--muted);
  border: 1px solid var(--border); background: var(--card);
  border-radius: 999px; padding: 4px 12px; margin-bottom: 22px;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; }
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--accent); animation: pulse 2s ease-out infinite;
}
@keyframes pulse { to { transform: scale(2.6); opacity: 0; } }

.prompt-line { display: none; }
.hero-name {
  font-size: clamp(3rem, 8vw, 5.6rem); font-weight: 800;
  letter-spacing: -0.045em; line-height: 1;
}
.cursor { display: none; }
.hero-role {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem); color: var(--accent);
  font-weight: 600; margin: 14px 0 18px;
}
.hero-lede { color: var(--muted); max-width: 560px; font-size: 1.08rem; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

.btn {
  display: inline-block; padding: 11px 22px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; border: 1px solid transparent;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: var(--border); color: var(--fg); background: var(--card); }
.btn.big { font-size: 1.1rem; padding: 14px 28px; margin: 6px 0 18px; }

.hero-photo { display: flex; justify-content: center; }
.avatar {
  position: relative; width: min(320px, 72vw); aspect-ratio: 1; border-radius: 50%;
}
/* spinning accent ring */
.avatar::before {
  content: ""; position: absolute; inset: -10px; border-radius: inherit;
  background: conic-gradient(from 0deg, var(--accent), transparent 30%, var(--accent) 55%, transparent 80%, var(--accent));
  animation: spin 9s linear infinite;
}
.avatar::after {
  content: ""; position: absolute; inset: -4px; border-radius: inherit; background: var(--bg);
}
.avatar img {
  position: relative; z-index: 1; width: 100%; height: 100%;
  border-radius: inherit; object-fit: cover;
  /* the source photo has a diamond border in its corners; a slight zoom hides it */
  transform: scale(1.04);
  clip-path: circle(48%);
}
@keyframes spin { to { transform: rotate(1turn); } }

.tech-strip {
  list-style: none; padding: 26px 0 0; margin: 48px 0 0;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  font-family: var(--font-mono); font-size: 0.88rem; color: var(--muted);
}

/* ============================================================
   Sections
   ============================================================ */
.section { padding: 88px 0; }
.section.alt { background: var(--bg-alt); }
.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800;
  letter-spacing: -0.03em; margin-bottom: 32px;
}
.pull { font-size: 1.35rem; font-weight: 600; line-height: 1.4; color: var(--fg); margin-bottom: 1.2em; }
.section p { color: var(--muted); }
.section .pull { color: var(--fg); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card h3 { font-size: 1.15rem; }
.card-role { font-size: 0.88rem; color: var(--accent) !important; margin: 6px 0 12px; font-weight: 500; }
.card p { font-size: 0.95rem; }
.card .tags { margin-top: auto; }
.badge {
  flex-shrink: 0; font-size: 0.72rem; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent);
  white-space: nowrap;
}

.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-family: var(--font-mono); font-size: 0.78rem;
  padding: 4px 10px; border-radius: 6px;
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--fg);
}
.section.alt .tags li { background: var(--card); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.job { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 0 0 44px 28px; position: relative; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: -7px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.job:first-child::before { background: var(--accent); }
.job-when { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); padding-top: 3px; }
.job h3 { font-size: 1.2rem; margin-bottom: 6px; }
.at { color: var(--accent); font-weight: 600; }
.job-meta { font-size: 0.85rem; font-style: italic; margin-bottom: 10px !important; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px 40px; }
.skill-group h3 {
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px; font-family: var(--font-mono);
}

/* Education */
.edu { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.edu-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; background: var(--card); }
.edu-item h3 { font-size: 1.15rem; margin: 6px 0 4px; }
.edu-item .at { margin-bottom: 10px; }

/* Life */
.life { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.life-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.life-icon { font-size: 1.8rem; display: block; margin-bottom: 10px; }
.life-item h3 { font-size: 1.05rem; margin-bottom: 8px; }
.life-item p { font-size: 0.93rem; margin: 0; }

/* Projects */
.section-lede { max-width: 640px; margin: -12px 0 48px; font-size: 1.05rem; }
.project {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 44px; align-items: center;
  padding: 0 0 72px;
}
.project:nth-of-type(even) .project-media { order: 2; }
.project-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.project-head h3 { font-size: 1.6rem; letter-spacing: -0.02em; }
.project-body .tags { margin: 18px 0 16px; }
.project-link { font-weight: 600; font-size: 0.95rem; }

.browser {
  margin: 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow);
  cursor: zoom-in;
}
.browser::before {
  /* fake window chrome with the site's address */
  content: "●  ●  ●     " attr(data-url);
  display: block; padding: 7px 12px; font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--muted); background: var(--bg-alt); border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.browser img { width: 100%; height: auto; transition: transform 0.4s ease; }
.browser:hover img { transform: scale(1.02); }

.phones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.phones img {
  width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border);
  cursor: zoom-in; transition: transform 0.2s ease;
}
.phones img:hover { transform: translateY(-4px); }

.sub-title {
  font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; font-family: var(--font-mono);
  color: var(--muted); margin: 8px 0 20px;
}
.wp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 24px; }
.wp-card .browser { margin-bottom: 18px; }
.wp-card .tags { margin: 4px 0 14px; }
.wp-card .card-head { margin-bottom: 10px; }
.shot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shot-pair .browser::before { font-size: 0.62rem; }

/* Case studies */
.project-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.case-btn {
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  color: var(--accent-ink); background: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px; padding: 8px 18px;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.case-btn::after { content: " →"; }
.case-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.wp-card .project-actions { margin-top: auto; padding-top: 4px; }
.wp-card { gap: 0; }

.case {
  width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--fg); overflow: hidden;
}
.case[open] { display: flex; flex-direction: column; animation: case-in 0.22s ease; }
@keyframes case-in { from { opacity: 0; transform: translateY(12px); } }
.case::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(3px); }
.case-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 22px; border-bottom: 1px solid var(--border); background: var(--bg-alt);
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted);
}
.case-close {
  font: inherit; font-size: 1.3rem; line-height: 1; background: none; border: 0;
  color: var(--muted); cursor: pointer; padding: 2px 6px;
}
.case-close:hover { color: var(--fg); }
.case-body { overflow-y: auto; padding: 28px 32px 36px; }
.case-body h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); letter-spacing: -0.03em; margin-bottom: 4px; }
.case-body .card-role { margin-bottom: 18px; }
.case-hero { margin: 0 0 26px; }
.case-hero.browser { cursor: default; }
.case-summary { font-size: 1.1rem; color: var(--fg); }
.case-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 22px 0 6px;
}
.case-stats div {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--card);
}
.case-stats b { display: block; font-size: 1.5rem; color: var(--accent); font-family: var(--font-head); line-height: 1.1; }
.case-stats span { font-size: 0.8rem; color: var(--muted); }
.case-body h3 {
  font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; font-family: var(--font-mono);
  color: var(--accent); margin: 30px 0 10px;
}
.case-body p, .case-body li { color: var(--muted); }
.case-body ul:not(.tags) { padding-left: 1.2em; margin: 0; }
.case-body ul:not(.tags) li { margin-bottom: 6px; }
.case-body ul:not(.tags) li strong { color: var(--fg); }
.case-body .tags { margin-top: 26px; }
.case-foot { margin-top: 26px; display: flex; gap: 18px; flex-wrap: wrap; }

/* ============================================================
   Case studies page
   ============================================================ */
.cs-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 48px; padding-bottom: 80px; }
.cs-nav { position: sticky; top: 96px; font-size: 0.92rem; }
.cs-back { display: inline-block; font-size: 0.85rem; margin-bottom: 22px; }
.cs-nav-title {
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.cs-nav ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.cs-nav ol a {
  display: flex; gap: 12px; padding: 9px 0 9px 16px; margin-left: -1px;
  border-left: 2px solid transparent; color: var(--muted); transition: color 0.15s ease, border-color 0.15s ease;
}
.cs-nav ol a:hover { color: var(--fg); text-decoration: none; }
.cs-nav ol a.active { color: var(--fg); border-left-color: var(--accent); }
.cs-nav .n { font-family: var(--font-mono); font-size: 0.75rem; padding-top: 3px; color: var(--accent); }
.cs-nav .t { display: flex; flex-direction: column; line-height: 1.3; font-weight: 600; white-space: nowrap; }
.cs-nav small { font-weight: 400; font-size: 0.76rem; color: var(--muted); }

.cs-intro { margin-bottom: 40px; }
.cs-intro h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.04em; margin: 6px 0 14px; }
.cs-intro p { color: var(--muted); max-width: 620px; }
.eyebrow { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); margin: 0; }

.cs { padding: 56px 0 64px; border-top: 1px solid var(--border); scroll-margin-top: calc(var(--nav-h, 64px) + 16px); }
.cs-head h2 { font-size: clamp(2.2rem, 5vw, 3.2rem); letter-spacing: -0.04em; margin: 8px 0 12px; }
.cs-summary { font-size: 1.15rem; color: var(--fg) !important; max-width: 720px; }
.cs-hero { margin: 26px 0 8px; }
.cs h3 {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin: 44px 0 16px;
}
.cs h4 { font-size: 1.2rem; margin: 0 0 10px; letter-spacing: -0.01em; }
.cs p, .cs li { color: var(--muted); }
.cs ul:not(.tags) { padding-left: 1.2em; margin: 0; }
.cs ul:not(.tags) li { margin-bottom: 6px; }
.cs code {
  font-family: var(--font-mono); font-size: 0.85em; padding: 1px 6px; border-radius: 4px;
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--fg);
}
.cs .tags { margin-top: 20px; }
.cs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.cs-cols h3 { margin-top: 36px; }
.cs-feature { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: start; margin-bottom: 36px; }
.cs-feature:nth-of-type(even) > :first-child { order: 2; }
.cs-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 4px 0 8px; }
.cs .phones { margin: 0; gap: 10px; }
.cs .phones.phones-3 { grid-template-columns: repeat(3, 1fr); }
.cs .phones.phones-6 { grid-template-columns: repeat(6, 1fr); margin-top: 8px; }
.cs-end { border-top: 1px solid var(--border); padding-top: 48px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cs-end p { width: 100%; font-size: 1.2rem; font-weight: 600; margin: 0 0 8px; }

.cs-caption { font-size: 0.82rem; margin-top: 10px; }
.cs-points { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; }

/* WhatsApp-style chat illustration */
.chat {
  --chat-bg: #0b141a; --chat-in: #202c33; --chat-out: #005c4b; --chat-fg: #e9edef; --chat-muted: #8696a0;
  background-color: var(--chat-bg); border-radius: 14px; overflow: hidden; border: 1px solid var(--border);
  font-family: "Inter", system-ui, sans-serif; font-size: 0.86rem; line-height: 1.45; color: var(--chat-fg);
  padding-bottom: 12px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px); background-size: 14px 14px;
}
.chat-head { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: #202c33; margin-bottom: 10px; }
.chat-head b { display: block; font-size: 0.92rem; }
.chat-head small { color: var(--chat-muted); font-size: 0.74rem; }
.chat-avatar { width: 34px; height: 34px; border-radius: 50%; background: #2a3942; display: grid; place-items: center; flex-shrink: 0; }
.msg {
  position: relative; max-width: 84%; margin: 6px 12px; padding: 6px 10px 7px; border-radius: 8px;
  background: var(--chat-in); width: fit-content;
}
.msg.bot { background: var(--chat-out); margin-left: auto; }
.msg .who { display: block; font-size: 0.74rem; font-weight: 600; color: #53bdeb; margin-bottom: 2px; }
.msg.host .who { color: #f7b955; }
.msg.bot .who { color: #7ee0c3; }
.msg .tag { color: #53bdeb; }
.msg .react {
  position: absolute; right: 6px; bottom: -12px; font-size: 0.8rem; background: #202c33;
  border: 1px solid #0b141a; border-radius: 999px; padding: 0 5px;
}
.msg.in:has(.react) { margin-bottom: 16px; padding-right: 26px; }
.img-ph {
  width: 190px; max-width: 100%; height: 92px; margin: 2px 0 6px; border-radius: 6px;
  background: linear-gradient(135deg, #2a3942, #111b21); display: grid; place-items: center; color: var(--chat-muted); font-size: 0.78rem;
}
.chat .chat-note { text-align: center; color: var(--chat-muted); font-size: 0.72rem; margin: 10px 0 0; }

/* Lightbox */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 92vh;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.82); }
.lightbox img { max-width: 94vw; max-height: 88vh; width: auto; height: auto; border-radius: 8px; }
.lightbox p { color: #ddd; text-align: center; font-size: 0.85rem; margin: 8px 0 0; }

/* Contact */
.socials { list-style: none; padding: 0; margin: 0; display: flex; justify-content: center; gap: 24px; }

.footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: 0.85rem; color: var(--muted); }
.footer p { margin: 0; }
.hint { opacity: 0.7; }

/* ============================================================
   Sublime theme flourishes
   ============================================================ */
[data-theme="sublime"] .editor-tabs {
  display: flex; background: #1e1f1c; padding: 0 16px;
  font-family: var(--font-mono); font-size: 0.8rem; border-top: 1px solid var(--border);
}
[data-theme="sublime"] .tab { padding: 7px 18px; color: var(--muted); border-right: 1px solid var(--border); }
[data-theme="sublime"] .tab.active { background: var(--bg); color: var(--fg); }
[data-theme="sublime"] .tab.active::after { content: " ×"; color: var(--muted); }
[data-theme="sublime"] .brand-a { color: var(--kw); }
[data-theme="sublime"] .brand-b { color: var(--accent); }
[data-theme="sublime"] .hero-name { letter-spacing: -0.04em; color: var(--fn); }
[data-theme="sublime"] .hero-role { color: var(--str); }
[data-theme="sublime"] .hero-role::before { content: '"'; }
[data-theme="sublime"] .hero-role::after { content: '"'; }
[data-theme="sublime"] .hero-lede strong { color: var(--type); font-weight: 500; }
[data-theme="sublime"] .section-title { font-size: 0; font-weight: 700; letter-spacing: -0.02em; color: var(--fn); }
[data-theme="sublime"] .section-title::before,
[data-theme="sublime"] .section-title::after { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
[data-theme="sublime"] .section-title::before { content: "def "; color: var(--kw); font-style: italic; }
[data-theme="sublime"] .section-title::after { content: attr(data-py) "():"; color: var(--fn); }
[data-theme="sublime"] .pull::before { content: "# "; }
[data-theme="sublime"] .pull { color: var(--comment); font-style: italic; }
[data-theme="sublime"] .section p strong { color: var(--str); font-weight: 500; }
[data-theme="sublime"] .at { color: var(--type); }
[data-theme="sublime"] .job-when { color: var(--num); }
[data-theme="sublime"] .tags li { color: var(--str); border-radius: 3px; }
[data-theme="sublime"] .badge { border-radius: 3px; color: var(--kw); border-color: var(--kw); }
[data-theme="sublime"] .btn { border-radius: var(--radius); font-family: var(--font-mono); }
[data-theme="sublime"] .case-btn { border-radius: var(--radius); font-family: var(--font-mono); }
[data-theme="sublime"] .case-body h3 { color: var(--comment); }
[data-theme="sublime"] .case-body h3::before { content: "# "; }
[data-theme="sublime"] .cs h3 { color: var(--comment); }
[data-theme="sublime"] .cs h3::before { content: "# "; }
[data-theme="sublime"] .cs-head h2 { color: var(--fn); }
[data-theme="sublime"] .cs-head h2::before { content: "class "; color: var(--kw); font-style: italic; font-size: 0.6em; }
[data-theme="sublime"] .cs h4 { color: var(--type); }
[data-theme="sublime"] .status, [data-theme="sublime"] .theme-picker select { border-radius: 3px; }
[data-theme="sublime"] .tech-strip li::after { content: ","; color: var(--muted); }
[data-theme="sublime"] .tech-strip li:last-child::after { content: ""; }
[data-theme="sublime"] .tech-strip { color: var(--str); }
[data-theme="sublime"] .tech-strip::before { content: "stack = ["; color: var(--fg); }
[data-theme="sublime"] .tech-strip::after { content: "]"; color: var(--fg); }
[data-theme="sublime"] .skill-group h3 { color: var(--comment); }
[data-theme="sublime"] .skill-group h3::before { content: "# "; }
[data-theme="sublime"] .section.alt { background: var(--bg-alt); }

/* ============================================================
   Terminal theme flourishes
   ============================================================ */
[data-theme="terminal"] body { font-size: 15.5px; }
[data-theme="terminal"] body::after {
  /* scanlines */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 200;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, 0.22) 3px);
}
[data-theme="terminal"] h1,
[data-theme="terminal"] h2,
[data-theme="terminal"] h3,
[data-theme="terminal"] .hero-role,
[data-theme="terminal"] .at { text-shadow: 0 0 6px color-mix(in srgb, var(--accent) 55%, transparent); }
[data-theme="terminal"] .term-bar {
  display: flex; align-items: center; gap: 7px; padding: 6px 16px;
  background: #111a11; border-top: 1px solid var(--border); font-size: 0.75rem; color: var(--muted);
}
[data-theme="terminal"] .dot { width: 10px; height: 10px; border-radius: 50%; }
[data-theme="terminal"] .dot.r { background: #ff5f56; }
[data-theme="terminal"] .dot.y { background: #ffbd2e; }
[data-theme="terminal"] .dot.g { background: #27c93f; }
[data-theme="terminal"] .term-title { margin-left: 10px; }
[data-theme="terminal"] .brand::before { content: "~/"; color: var(--muted); }
[data-theme="terminal"] .brand-a { color: var(--accent); }
[data-theme="terminal"] .nav-links a::before { content: "./"; opacity: 0.5; }
[data-theme="terminal"] .status { display: none; }
[data-theme="terminal"] .prompt-line { display: block; color: var(--muted); margin-bottom: 10px; }
[data-theme="terminal"] .hero-name {
  color: var(--accent); font-weight: 700; letter-spacing: -0.05em;
  font-size: clamp(2.2rem, 6.4vw, 4.6rem); white-space: nowrap;
}
[data-theme="terminal"] .cursor {
  display: inline-block; width: 0.5em; height: 0.85em; margin-left: 0.12em;
  background: var(--accent); vertical-align: baseline; animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
[data-theme="terminal"] .hero-role::before { content: "> "; }
[data-theme="terminal"] .section { padding: 64px 0; border-top: 1px dashed var(--border); }
[data-theme="terminal"] .section-title { font-size: 1.05rem; font-weight: 400; color: var(--fg); letter-spacing: 0; }
[data-theme="terminal"] .section-title::before { content: "jared@ozzy:~$ " attr(data-cmd); color: var(--accent); }
[data-theme="terminal"] .section-title { font-size: 0; } /* hide the plain label, keep it for screen readers via the prompt */
[data-theme="terminal"] .section-title::before { font-size: 1.05rem; }
[data-theme="terminal"] .pull::before { content: "## "; color: var(--muted); }
[data-theme="terminal"] .section p { color: var(--fg); opacity: 0.88; }
[data-theme="terminal"] .card,
[data-theme="terminal"] .edu-item,
[data-theme="terminal"] .life-item { border-style: dashed; }
[data-theme="terminal"] .card:hover { transform: none; }
[data-theme="terminal"] .browser,
[data-theme="terminal"] .phones img { border-radius: 0; border-style: dashed; }
[data-theme="terminal"] .browser::before { content: "$ open https://" attr(data-url); }
[data-theme="terminal"] .case-btn { border-radius: 0; }
[data-theme="terminal"] .case-btn::before { content: "$ "; }
[data-theme="terminal"] .case-btn::after { content: " --open"; }
[data-theme="terminal"] .case-stats div { border-style: dashed; }
[data-theme="terminal"] .case-body h3::before { content: "## "; }
[data-theme="terminal"] .cs h3::before { content: "## "; }
[data-theme="terminal"] .cs-head h2::before { content: "$ cat "; color: var(--muted); font-size: 0.5em; vertical-align: middle; }
[data-theme="terminal"] .cs-nav ol a.active .n::before { content: "> "; }
[data-theme="terminal"] .cs-nav ol a { border-radius: 0; }
[data-theme="terminal"] .chat { border-style: dashed; }
[data-theme="terminal"] .tags li { background: transparent !important; border-style: dashed; color: var(--accent); }
[data-theme="terminal"] .tags li::before { content: "["; opacity: 0.6; }
[data-theme="terminal"] .tags li::after { content: "]"; opacity: 0.6; }
[data-theme="terminal"] .tags li { border: 0; padding: 2px 4px; }
[data-theme="terminal"] .btn { border-radius: 0; }
[data-theme="terminal"] .btn.primary::before { content: "[ "; }
[data-theme="terminal"] .btn.primary::after { content: " ]"; }
[data-theme="terminal"] .badge { border-radius: 0; }
[data-theme="terminal"] .timeline { border-left-style: dashed; }
[data-theme="terminal"] .job::before { border-radius: 0; }
[data-theme="terminal"] .job-when::before { content: "commit "; opacity: 0.6; }
[data-theme="terminal"] .life-icon { filter: grayscale(1) brightness(1.4); }
[data-theme="terminal"] .avatar img { filter: grayscale(1) sepia(1) hue-rotate(65deg) saturate(2.2) brightness(0.95) contrast(1.1); }
[data-theme="terminal"] .avatar::before { background: none; border: 2px dashed var(--accent); inset: -12px; animation: spin 40s linear infinite; }
[data-theme="terminal"] .avatar::after { display: none; }
[data-theme="terminal"] .tech-strip li::before { content: "$ "; opacity: 0.5; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .cs-layout { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
  .cs-nav {
    position: sticky; top: var(--nav-h, 61px); z-index: 40; margin: 0 -24px; padding: 10px 24px;
    background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
  }
  .cs-nav::-webkit-scrollbar { display: none; }
  .cs-back, .cs-nav-title { display: none; }
  .cs-nav ol { display: flex; gap: 8px; border: 0; width: max-content; }
  .cs-nav ol a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; margin: 0; white-space: nowrap; }
  .cs-nav ol a.active { border-color: var(--accent); }
  .cs-nav small { display: none; }
  .cs { scroll-margin-top: calc(var(--nav-h, 64px) + 58px); }
  .cs-intro { margin-top: 32px; }
  .cs-cols, .cs-feature, .cs-gallery, .cs-points { grid-template-columns: 1fr; gap: 20px; }
  .cs-feature:nth-of-type(even) > :first-child { order: 0; }
  .cs .phones.phones-6 { grid-template-columns: repeat(3, 1fr); }

  .nav-links { display: none; }
  .controls { margin-left: auto; }
  .hero { padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-photo { order: -1; justify-content: flex-start; }
  .avatar { width: 160px; }
  .job { grid-template-columns: 1fr; gap: 4px; }
  .project { grid-template-columns: 1fr; gap: 22px; padding-bottom: 56px; }
  .project:nth-of-type(even) .project-media { order: 0; }
  .section { padding: 64px 0; }
}
@media (max-width: 480px) {
  .cs-nav { margin: 0 -16px; padding: 10px 16px; }
  .case-body { padding: 20px 18px 28px; }
  .case-top { padding: 12px 16px; }
  .wrap, .nav-inner { padding-left: 16px; padding-right: 16px; }
  body { font-size: 16px; }
  .editor-tabs .tab:not(.active) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Print = a clean one-colour CV */
@media print {
  html[data-theme] {
    --bg: #fff; --bg-alt: #fff; --card: #fff; --fg: #111; --muted: #333;
    --border: #ccc; --font-body: "Inter", sans-serif; --font-head: "Inter", sans-serif;
  }
  body::after { display: none; }
  .nav, .hero-cta, .footer, .accent-btn, .socials { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section { padding: 18px 0; background: none !important; }
  .card, .edu-item, .life-item { box-shadow: none; break-inside: avoid; }
}
.case-btn:hover { text-decoration: none; }
