/*
Theme Name: Albert Fit
Theme URI: https://albert-fit.com
Author: Albert Fit
Description: Hand-written, zero-JavaScript portfolio theme for albert-fit.com. No page builder, no plugins required.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: Proprietary
Text Domain: albert-fit
*/

/* ---------- tokens ---------- */
:root {
  /* Apple-style neutrals + titanium khaki + orange accent */
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --khaki: #8a8272;        /* natural titanium — labels, tags, kicker */
  --ivory: #f7f4ee;        /* natural wood / ivory — About section only */
  --accent: #d9480f;       /* Ultra orange, darkened to pass contrast on white */
  --accent-ink: #ffffff;
  --line: #e8e8ed;         /* titanium */
  --card: #ffffff;
  --glass: rgba(255,255,255,.72);
  --radius: 14px;
  --max: 72rem;
  --measure: 66ch;
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #1d1d1f;
    --fg: #f5f5f7;
    --muted: #a1a1a6;
    --khaki: #b5ad9b;
    --ivory: #161513;
    --accent: #ff9f0a;
    --accent-ink: #1d1d1f;
    --line: #424245;
    --card: #1d1d1f;
    --glass: rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); font-weight: 650; }
h3 { font-size: 1.15rem; font-weight: 650; }
p, ul, ol, table { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li + li { margin-top: 0.3em; }
strong { font-weight: 650; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--bg-alt); padding: 0.1em 0.35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.measure { max-width: var(--measure); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 0.5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section + .section { border-top: 1px solid var(--line); }
.section-alt { background: var(--bg-alt); }
#about { background: var(--ivory); }
.grid { display: grid; gap: 1.25rem; }
@media (min-width: 720px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- header / nav ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); position: sticky; top: 0; z-index: 10; }
@supports not (backdrop-filter: blur(1px)) { .site-header { background: var(--bg); } }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; letter-spacing: -0.01em; }
.nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.nav a { color: var(--fg); text-decoration: none; font-size: 0.95rem; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"], .nav a:hover { border-bottom-color: var(--accent); }

/* ---------- hero ---------- */
.hero { padding-block: clamp(3rem, 8vw, 6rem); }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 760px) { .hero-grid { grid-template-columns: 1.6fr 1fr; } }
.hero .kicker { color: var(--khaki); font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 0.75rem; }
.hero .lede { font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--muted); max-width: 40ch; }
.hero .headline { font-size: 1.05rem; color: var(--muted); margin-top: 0.5rem; }
.headshot { width: min(100%, 320px); aspect-ratio: 1; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); margin-inline: auto; background: var(--bg-alt); }
.headshot-placeholder { display: grid; place-items: center; font-size: 4rem; font-weight: 700; color: var(--muted); }
.cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.btn { display: inline-block; padding: 0.7rem 1.2rem; border-radius: 999px; text-decoration: none; font-weight: 650; border: 1.5px solid var(--accent); line-height: 1.2; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { color: var(--accent); background: transparent; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }

/* ---------- proof strip ---------- */
.proof { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
@media (min-width: 720px) { .proof { grid-template-columns: repeat(4, 1fr); } }
.proof b { display: block; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.proof span { color: var(--muted); font-size: 0.9rem; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.card h3 { margin: 0; }
.card .result { color: var(--accent); font-weight: 650; }
.card .more { margin-top: auto; padding-top: 0.5rem; font-size: 0.95rem; }
.card .tag { font-family: var(--mono); font-size: 0.78rem; color: var(--khaki); }
.card { border-color: transparent; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05); }
.section-alt .card { border-color: transparent; }

/* ---------- stack / chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; list-style: none; }
.chips li { border: 0; background: var(--bg-alt); color: var(--fg); border-radius: 999px; padding: 0.35rem 0.8rem; font-size: 0.9rem; margin: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 650; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }

/* ---------- case study ---------- */
.callout { border-left: 3px solid var(--accent); background: var(--bg-alt); padding: 0.9rem 1.1rem; border-radius: 0 var(--radius) var(--radius) 0; }
.figure { margin: 1.5rem 0; }
.figure figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }
.diagram { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.diagram svg { width: 100%; min-width: 680px; height: auto; }
.diagram figcaption { position: sticky; left: 0; }
.diagram text { font-family: var(--font); font-size: 13px; fill: var(--fg); }
.diagram .box { fill: var(--bg-alt); stroke: var(--line); stroke-width: 1.2; rx: 8; }
.diagram .box-accent { fill: var(--accent); stroke: none; }
.diagram .label-accent { fill: var(--accent-ink); font-weight: 650; }
.diagram .arrow { stroke: var(--muted); stroke-width: 1.5; fill: none; marker-end: url(#arrowhead); }
.diagram .arrowhead { fill: var(--muted); }
.diagram .note { fill: var(--muted); font-size: 11.5px; }
.toc { font-size: 0.95rem; }
.toc a { margin-right: 1rem; }

/* ---------- CV page ---------- */
.cv h2 { margin-top: 2.25rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--line); }
.cv .role { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.cv .role h3 { margin: 0; }
.cv .role .dates { color: var(--muted); font-size: 0.95rem; white-space: nowrap; }
.cv .org { color: var(--muted); margin: 0 0 0.5rem; }
.cv dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; }
.cv dt { font-weight: 650; }
.cv dd { margin: 0; }
@media (max-width: 520px) { .cv dl { grid-template-columns: 1fr; } .cv dd { margin-bottom: 0.4rem; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer a { color: inherit; }

/* ---------- generic page content ---------- */
.entry-content > *:first-child { margin-top: 0; }
.entry-content img { border-radius: var(--radius); }

@media print {
  .site-header, .site-footer, .cta, .skip-link { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; text-decoration: none; }
}
