/* ==========================================================================
   Portfolio — Design System v2
   Unified on the original Terracotta system from design.md
   --------------------------------------------------------------------------
   How to use:
   1. Add this file as css/design-system.css in the Portfolio repo.
   2. Load it AFTER css/style.css in index.html:
        <link rel="stylesheet" href="css/style.css">
        <link rel="stylesheet" href="css/design-system.css">
   3. Do not edit style.css in the same change. This file is the single
      source of truth for colour, radius, shadow, type and motion.
      Anything that disagrees with it is a bug in style.css, not here.

   Rules carried over from design.md:
   - One strong accent only: Terracotta #C54716.
     Deep green is NOT a primary colour. It appears only as Sage
     #5E7A65 for a quiet success / available state.
   - No multi-colour gradients, no glassmorphism, no neon.
     Flat surfaces, 1px hairlines, subtle shadows only.
   - Space Grotesk for headings and body, IBM Plex Mono for technical
     labels only, Instrument Serif for one italic word in a large
     heading only — never for a whole heading.
   - Calm motion: opacity + a small vertical move only.
   ========================================================================== */

:root {
  /* Canonical tokens — exactly as specified in design.md */
  --bg: #F9F7F0;
  --bg-deep: #2B1D14;
  --surface: #EFE8DC;
  --surface-raised: #E6D9C8;
  --surface-quiet: #F4EFE6;
  --border: #D7C8B8;
  --text: #2B1D14;
  --muted: #6F625A;
  --accent: #C54716;
  --accent-light: #9F3600;
  --sage: #5E7A65;
  --blue: #526A91;

  /* One accent tint for use on dark surfaces only.
     --accent-light (#9F3600) is too dark on #2B1D14, so dark sections
     use this lighter terracotta instead. It is not a second accent. */
  --accent-on-dark: #E8A87C;

  /* Aliases — map the old token names used in style.css to the
     canonical values above, so existing rules pick up the new system
     without a full rewrite of style.css. */
  --ink: var(--text);
  --ink-soft: var(--muted);
  --paper: var(--surface-quiet);
  --paper-strong: #FFFDF8;
  --cream: #FFF8ED;
  --deep: var(--bg-deep);
  --deep-2: #17100C;
  --line: var(--border);
  --line-strong: #BFB3A6;
  --accent-dark: var(--accent-light);

  /* Radius — one scale, used everywhere. No 99px pills on buttons,
     no 1.2rem / 0.3rem mixed corners. */
  --radius-1: 2px;
  --radius-2: 3px;
  --radius-3: 4px;
  --radius-4: 6px;

  /* Shadow — flat, warm, subtle. No glow, no coloured shadow. */
  --shadow-1: 0 1px 2px rgba(43, 29, 20, 0.06);
  --shadow-2: 0 8px 20px rgba(43, 29, 20, 0.08);
  --shadow-3: 0 16px 32px rgba(43, 29, 20, 0.10);

  /* Type — already loaded in index.html */
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Spacing and motion — keep the existing 8px scale */
  --container: 1152px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-reveal: 450ms;
  --duration-hover: 180ms;
}

body {
  color: var(--text);
  background: var(--bg);
}

/* ==========================================================================
   Buttons and links — Terracotta is the only primary action colour
   ========================================================================== */

.btn {
  border-radius: var(--radius-2);
}

.btn-primary {
  color: var(--cream);
  background: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: var(--shadow-1);
}

.btn-ghost {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--paper-strong);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--paper-strong);
}

/* Hero and contact buttons were pill-shaped (99px) in the studio layer.
   Revert to the editorial 3px radius. */
#hero .hero-actions .btn,
#contact .btn {
  border-radius: var(--radius-2);
  font: 600 0.72rem var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Nav CTA: dark, not green, not pill. Hover goes to Terracotta. */
#site-nav a.nav-project-cta:not(.logo) {
  background: var(--bg-deep);
  color: var(--cream);
  border-radius: var(--radius-2);
  padding: 0.65rem 1rem;
}

#site-nav a.nav-project-cta:not(.logo):hover,
#site-nav a.nav-project-cta:not(.logo).active {
  color: var(--cream);
  background: var(--accent);
}

/* ==========================================================================
   Hero — flat cream, Space Grotesk heading, one serif italic word
   ========================================================================== */

#hero {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding-block: clamp(2.4rem, 6.5vw, 6.5rem) clamp(2.7rem, 6.6vw, 6.6rem);
}

/* Remove the radial gradient and the grid overlay tint from the
   studio layer. The paper texture in body::before stays. */
#hero::after {
  background: none;
}

#hero h1 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(2.6rem, 5.8vw, 5.4rem);
  line-height: 0.96;
  letter-spacing: -0.065em;
  color: var(--text);
}

/* Only the italic word is serif, and only in Terracotta. */
#hero h1 em,
h2 em,
.contact-title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -0.025em;
}

#hero .hero-desc {
  color: var(--muted);
}

/* Hero art — flat surface, hairline border, Terracotta stamp.
   No repeating gradient, no peach gradient, no green stamp. */
.hero-art {
  background: var(--surface-quiet);
  border: 1px solid var(--border);
  border-radius: var(--radius-4) var(--radius-2) var(--radius-4) var(--radius-2);
  color: var(--text);
  box-shadow: var(--shadow-2);
}

.hero-art-top,
.hero-art figcaption {
  border-color: var(--border);
}

.hero-art figcaption {
  background: var(--surface-quiet);
}

.hero-art-stage {
  background: var(--surface);
}

.hero-art-portrait {
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-1);
}

.hero-art-stamp {
  background: var(--accent);
  color: var(--cream);
  box-shadow: var(--shadow-1);
}

/* Status dot: Sage only, for "available". Never green #10B981. */
.status-dot,
.nav-status-pill .status-dot {
  background: var(--sage);
  box-shadow: 0 0 6px var(--sage);
}

/* ==========================================================================
   Sections — flat surfaces, hairlines, one radius scale
   ========================================================================== */

#projects {
  background: var(--bg);
}

#experience,
#education {
  background: var(--paper);
}

.divider {
  background: var(--border);
}

/* Section headings keep the editorial two-column layout from
   style.css, with the label in Terracotta mono. */
.section-label,
.hero-kicker,
.project-kicker {
  color: var(--accent);
}

/* ==========================================================================
   Projects — flat image frames, Terracotta filter, no gradients
   ========================================================================== */

/* Remove every gradient used as an image background. */
.featured-project .project-card-img,
.additional-projects-grid .project-card-img,
.additional-projects-grid .project-card-visual {
  background: var(--surface);
  border-color: var(--line-strong);
  border-radius: var(--radius-4);
  box-shadow: var(--shadow-1);
}

.project-card-visual {
  background: var(--bg-deep);
  color: var(--cream);
}

.project-card-visual::before,
.project-card-visual--realestate::before,
.project-card-visual--quicktasks::before,
.project-card-visual--itqan::before,
.project-card-visual--market::before,
.project-card-visual--quran::before,
.project-card-visual--okfbi::before,
.project-card-visual--andalusia::before,
.project-card-visual--phone::before {
  background: var(--bg-deep);
}

.visual-kicker {
  color: var(--accent-on-dark);
}

.visual-line {
  background: var(--accent-on-dark);
}

/* Live-preview browser frame: flat, 6px radius, hairline only. */
.project-live-preview,
.featured-project .project-live-preview,
.additional-projects-grid .project-live-preview {
  background: #FFFFFF;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-4);
  box-shadow: var(--shadow-2);
}

/* Filter bar: 3px radius, active pill is Terracotta, not green. */
.filter-bar {
  border: 1px solid var(--border);
  background: var(--paper-strong);
  border-radius: var(--radius-2);
  padding: 3px;
  gap: 2px;
}

.filter-btn {
  border-radius: var(--radius-1);
  font: 500 0.72rem var(--mono);
  color: var(--muted);
}

.filter-btn.active {
  background: var(--accent);
  color: var(--cream);
}

/* Project cards: 2px radius, flat, hairline border. */
.additional-projects-grid .project-card {
  border: 1px solid var(--border);
  background: var(--paper-strong);
  border-radius: var(--radius-1);
}

.additional-projects-grid .project-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}

.project-badge-pill {
  background: rgba(197, 71, 22, 0.08);
  color: var(--accent);
  border: 1px solid rgba(197, 71, 22, 0.2);
  border-radius: var(--radius-1);
}

.project-facts dt {
  color: var(--muted);
}

.project-facts dd {
  color: var(--text);
}

.project-link {
  color: var(--accent-light);
}

.project-link-arrow {
  color: var(--accent);
}

/* ==========================================================================
   Services and Process — flat, no per-card colours, no green primary
   ========================================================================== */

.services-section {
  background: var(--surface);
}

.service-grid {
  gap: 1rem;
}

.service-card {
  padding: clamp(1.1rem, 2.6vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-4) var(--radius-2);
  background: var(--surface-quiet);
}

/* Remove the three different card colours from the studio layer. */
.service-card:nth-child(2),
.service-card:nth-child(3) {
  background: var(--surface-quiet);
  border-color: var(--border);
}

.service-index {
  color: var(--accent);
}

.service-card h3,
.process-steps h3 {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.035em;
}

/* Process: dark Espresso (design.md: dark surfaces are --bg-deep),
   not dark green. Accent text is the light terracotta tint. */
.process-section {
  background: var(--bg-deep);
  color: var(--cream);
}

.process-section h2 em,
.process-section .section-label {
  color: var(--accent-on-dark);
}

.process-section .text-link,
.process-steps li {
  border-color: rgba(255, 248, 237, 0.2);
}

.process-steps li > span {
  color: var(--accent-on-dark);
}

/* ==========================================================================
   Education, references, contact, footer — dark = Espresso only
   ========================================================================== */

.edu-card {
  background: var(--bg-deep);
  color: var(--cream);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
}

.edu-inst {
  color: var(--accent-on-dark);
}

.cert-item {
  border: 1px solid var(--border);
  background: var(--paper-strong);
  border-radius: var(--radius-1);
}

.cert-badge {
  color: var(--sage);
}

#contact {
  background: var(--bg-deep);
  color: var(--cream);
}

#contact .section-label,
.contact-lead-label,
.contact-status-badge {
  color: var(--accent-on-dark);
}

.contact-primary-email:hover {
  color: var(--accent-on-dark);
}

.contact-link-accent {
  background: rgba(197, 71, 22, 0.2);
  border-color: var(--accent);
  color: #FFC2A6;
}

.contact-link-accent:hover {
  background: var(--accent);
  color: #FFFFFF;
}

footer {
  background: var(--bg-deep);
  border-top: 1px solid rgba(255, 248, 237, 0.12);
  color: rgba(255, 248, 237, 0.48);
}

/* Scroll progress and focus: Terracotta only. */
.scroll-progress-bar {
  background: var(--accent);
  box-shadow: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Timeline dot and spine progress: Terracotta only. */
.tl-dot {
  border: 2px solid var(--accent);
}

.tl-dot.is-active,
.tl-item.tl-active .tl-dot {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(197, 71, 22, 0.25);
}

.tl-spine-progress {
  background: var(--accent);
}

.tl-company {
  color: var(--accent-light);
}
