/* ==========================================================================
   Alvin Lee — portfolio
   Plain CSS, no build step. Tweak the tokens below to restyle the whole site.
   ========================================================================== */

:root {
  /* Color */
  --bg: #fbfaf8;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: #e6e3de;
  --accent: #2f5bea;
  --accent-soft: #eef2fe;

  /* Type */
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.5rem, 5vw + 1rem, 3.75rem);

  /* Layout */
  --content: 720px;
  --wide: 1080px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #1a1a1a;
    --text: #ededed;
    --text-muted: #9a9a9a;
    --border: #2a2a2a;
    --accent: #7c9cff;
    --accent-soft: #1b2440;
  }
}

/* Base ------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

h1 { font-size: var(--step-4); font-weight: 650; }
h2 { font-size: var(--step-2); font-weight: 600; margin-top: 2.5em; }
h3 { font-size: var(--step-1); font-weight: 600; margin-top: 1.75em; }

p,
ul,
ol {
  margin: 0 0 1.1em;
}

.skip-link {
  position: absolute;
  left: -999px;
}
.skip-link:focus {
  left: var(--gutter);
  top: 1rem;
  background: var(--surface);
  padding: 0.5rem 0.75rem;
}

/* Layout ----------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.prose {
  max-width: var(--content);
}

/* Header / footer -------------------------------------------------------- */

.site-header {
  padding: 1.75rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-weight: 650;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  gap: 1.5rem;
  font-size: var(--step--1);
}

.nav a {
  text-decoration: none;
  color: var(--text-muted);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

.site-footer {
  margin-top: 6rem;
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border);
  font-size: var(--step--1);
  color: var(--text-muted);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1.25rem;
}

/* Home ------------------------------------------------------------------- */

.hero {
  padding-top: clamp(3rem, 10vw, 7rem);
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

.hero h1 {
  max-width: 16ch;
}

.hero .lede {
  font-size: var(--step-1);
  color: var(--text-muted);
  max-width: 34rem;
}

.section-label {
  font-size: var(--step--1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.work-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: inherit;
}

.card-media {
  aspect-ratio: 16 / 10;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: var(--step--1);
  font-family: var(--font-mono);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 1.25rem 1.25rem 1.5rem;
}

.card-body h3 {
  margin: 0 0 0.35rem;
}

.card-body p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--step--1);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
  padding: 0;
  list-style: none;
}

.tags li {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
}

/* Case study ------------------------------------------------------------- */

.case-header {
  padding: clamp(2.5rem, 8vw, 5rem) 0 2rem;
}

.eyebrow {
  font-size: var(--step--1);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.case-header .lede {
  font-size: var(--step-1);
  color: var(--text-muted);
  max-width: 40rem;
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.meta dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.meta dd {
  margin: 0;
  font-size: var(--step--1);
}

.figure {
  margin: 2.5rem 0;
}

.figure-placeholder {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  padding: 1rem;
  text-align: center;
}

.figure figcaption {
  margin-top: 0.75rem;
  font-size: var(--step--1);
  color: var(--text-muted);
}

.decision {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.decision h3 {
  margin-top: 0;
}

.decision p:last-child {
  margin-bottom: 0;
}

.todo {
  background: #fff6d6;
  color: #5c4a00;
  padding: 0 0.25em;
  border-radius: 3px;
}

@media (prefers-color-scheme: dark) {
  .todo {
    background: #3a3110;
    color: #f3dd85;
  }
}

.next-case {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.next-case a {
  font-size: var(--step-2);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.02em;
}

/* About ------------------------------------------------------------------ */

.about-grid {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
  padding-top: clamp(2.5rem, 8vw, 5rem);
}

@media (min-width: 860px) {
  .about-grid {
    grid-template-columns: 280px 1fr;
  }
}

.portrait {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--step--1);
}

/* Motion ----------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
