@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0&display=block");

/* =========================================================
   THEME 4 — "Blueprint"
   Cool, professional, techy. A near-white/light-grey canvas
   (no warm cream) with the brand plum #443143 as the SINGLE
   accent — no orange/terracotta. Space Grotesk display + DM Sans
   body + DM Mono labels, a faint cool blueprint grid, sharp
   corners and square icon tiles.
   #443143 is headings ink, the lone accent, primary buttons and
   the deep CTA slab.
   ========================================================= */

:root {
  --plum: #443143;           /* brand anchor — the only accent */
  --plum-hover: #5a4257;
  --bg: #f4f5f7;             /* cool near-white */
  --bg-2: #eaecf0;
  --surface: #ffffff;

  --color-bg: var(--bg);
  --color-bg-alt: var(--bg-2);
  --color-surface: var(--surface);
  --color-surface-hover: #f7f8fa;
  --color-border: rgba(36, 38, 50, 0.10);
  --color-border-strong: rgba(36, 38, 50, 0.20);
  --color-text: #21242c;
  --color-text-muted: #5a5f6b;
  --color-text-faint: #989eab;
  --color-brand-deep: var(--plum);
  --color-accent: var(--plum);
  --color-accent-strong: var(--plum);
  --color-accent-glow: rgba(68, 49, 67, 0.12);

  --font-body: "DM Sans", system-ui, sans-serif;
  --font-display: "Space Grotesk", "DM Sans", sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;

  --radius: 6px;
  --radius-sm: 4px;
}

/* Light theme: show the logo's true plum */
.brand__logo { filter: none; }

/* ---- Body: clean cool canvas, faint top wash ---- */
body {
  background-color: var(--bg);
  color: var(--color-text);
  background-image:
    radial-gradient(58% 42% at 50% -8%, rgba(68, 49, 67, 0.05), transparent 70%);
  background-repeat: no-repeat;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ---- Header ---- */
.site-header {
  background-color: transparent;
  border-bottom: 1px solid var(--color-border-strong);
}
/* Glass on the pseudo-element (see style.css) so the header stays free of a
   fixed-positioning containing block. */
.site-header::before {
  background-color: rgba(244, 245, 247, 0.85);
  backdrop-filter: saturate(120%) blur(10px);
}
.brand__tagline {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.64rem;
  color: var(--color-text-muted);
  border-left-color: var(--color-border-strong);
}
.nav-cta {
  background-color: var(--plum);
  border: 1px solid var(--plum);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  box-shadow: 0 3px 10px -8px rgba(68, 49, 67, 0.4);
  transition: border-color var(--transition), color var(--transition),
    background-color var(--transition), transform var(--transition),
    box-shadow var(--transition);
}
.nav-cta:hover {
  background-color: var(--plum-hover);
  border-color: var(--plum-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -10px rgba(68, 49, 67, 0.5);
}
.site-nav__link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.site-nav__link:hover { color: var(--plum); }

/* ---- Eyebrow: mono with a // prefix ---- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  font-weight: 500;
  color: var(--plum);
  background: none;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "// ";
  opacity: 0.6;
}

/* ---- Hero ---- */
.hero__inner { max-width: 820px; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.3rem, 6.5vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--color-text);
}
.hero__subtitle {
  font-size: clamp(1.05rem, 2.3vw, 1.3rem);
  color: var(--color-text-muted);
  max-width: 600px;
}

/* ---- Sections ---- */
.section--alt {
  background-color: var(--color-bg-alt);
  border-block: 1px solid var(--color-border);
}
.section__title {
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: var(--color-text);
}
/* short plum accent rule */
.section__title::after {
  width: 44px;
  height: 2px;
  border-radius: 0;
  background-color: var(--plum);
}

/* ---- Buttons: crisp, slightly squared ---- */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition),
    background-color var(--transition), border-color var(--transition);
}
.btn--primary {
  background-color: var(--plum);
  color: #ffffff;
  box-shadow: 0 3px 10px -8px rgba(68, 49, 67, 0.35);
}
.btn--primary:hover {
  background-color: var(--plum-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -10px rgba(68, 49, 67, 0.4);
}
.btn--ghost {
  background: transparent;
  border-color: var(--color-border-strong);
  color: var(--plum);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.btn--ghost:hover {
  border-color: var(--plum);
  color: var(--plum);
  transform: translateY(-2px);
}

/* ---- Cards: hairline tiles ---- */
.card {
  position: relative;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px -14px rgba(36, 38, 50, 0.2);
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}
.card:hover {
  border-color: var(--plum);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px -16px rgba(36, 38, 50, 0.24);
}
.card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--color-text);
}

/* ---- Projects: monospace index ---- */
.project {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px -14px rgba(36, 38, 50, 0.2);
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}
.project:hover {
  border-color: var(--plum);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px -16px rgba(36, 38, 50, 0.24);
}
.project__index {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--plum);
}
.project__title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-text);
}

/* ---- Technical profile ---- */
.tech-role {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-text);
}
.tech-subtitle {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

/* ---- CV gate ---- */
.cv-gate__input {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-mono);
}
.cv-gate__input:focus {
  border-color: var(--plum);
  box-shadow: 0 0 0 3px rgba(68, 49, 67, 0.14);
}
.cv-gate__error { color: #c0392b; }

/* ---- CTA: deep plum slab with a faint grid ---- */
.section--cta {
  background-color: var(--plum);
  background-image: linear-gradient(180deg, #50394e 0%, var(--plum) 60%);
  border-block: 1px solid var(--color-border);
}
.section--cta .cta__title { color: #ffffff; }
.section--cta .cta__text { color: rgba(255, 255, 255, 0.8); }
.section--cta .eyebrow { color: #d9c7d6; }
.channel {
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  transition: border-color var(--transition), background-color var(--transition),
    color var(--transition);
}
.channel:hover {
  color: var(--plum);
  background: #ffffff;
  border-color: #ffffff;
}

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--color-border); }

/* ---- Switcher ---- */
.theme-switcher__toggle,
.theme-switcher__slots {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  box-shadow: 0 6px 18px -14px rgba(36, 38, 50, 0.25);
}
.theme-switcher__toggle { font-family: var(--font-mono); }
.theme-slot {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.theme-slot.is-active {
  color: var(--plum);
  border-color: var(--plum);
  background-color: var(--color-surface-hover);
}

/* =========================================================
   ICONS — Material Symbols in square blueprint tiles
   Decorative only (`content: "name" / ""` = empty a11y name).
   ========================================================= */
#services-list .card::before,
#profile-list .card::before,
#tech-stack-list .card::before,
.project__title::before,
.channel::before,
.nav-cta::before {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga";
}

/* Card icon: square tile, hairline, plum glyph */
#services-list .card::before,
#profile-list .card::before,
#tech-stack-list .card::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: var(--space-md);
  font-size: 1.35rem;
  color: var(--plum);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
}

#services-list .card:nth-child(1)::before { content: "design_services" / ""; }
#services-list .card:nth-child(2)::before { content: "handshake" / ""; }
#services-list .card:nth-child(3)::before { content: "lightbulb" / ""; }
#services-list .card:nth-child(4)::before { content: "school" / ""; }

#profile-list .card:nth-child(1)::before { content: "trending_up" / ""; }
#profile-list .card:nth-child(2)::before { content: "bolt" / ""; }
#profile-list .card:nth-child(3)::before { content: "rocket_launch" / ""; }

#tech-stack-list .card:nth-child(1)::before { content: "dns" / ""; }
#tech-stack-list .card:nth-child(2)::before { content: "code" / ""; }
#tech-stack-list .card:nth-child(3)::before { content: "hub" / ""; }
#tech-stack-list .card:nth-child(4)::before { content: "smart_toy" / ""; }

.project__title::before {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 1.05em;
  vertical-align: -0.12em;
  color: var(--plum);
}
#projects-list .project:nth-child(1) .project__title::before { content: "auto_awesome" / ""; }
#projects-list .project:nth-child(2) .project__title::before { content: "join_inner" / ""; }
#projects-list .project:nth-child(3) .project__title::before { content: "travel_explore" / ""; }

.channel::before {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 1.1em;
  vertical-align: -0.18em;
}
.cta__channels .channel:nth-child(1)::before { content: "captive_portal" / ""; }
.cta__channels .channel:nth-child(2)::before { content: "mail" / ""; }
.cta__channels .channel:nth-child(3)::before { content: "call" / ""; }

.nav-cta::before {
  content: "north_east" / "";
  display: inline-block;
  margin-right: 0.4rem;
  font-size: 1em;
  vertical-align: -0.15em;
}

/* =========================================================
   BLUEPRINT SIGNATURE — terminal line, schematic, ticker
   (base style.css hides these; this file reveals them)
   ========================================================= */

/* Hero becomes a positioning context for the schematic */
.hero { position: relative; overflow: hidden; }
.hero__inner { position: relative; z-index: 2; }

/* ---- Hero terminal (typewriter) ---- */
.hero__term {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--plum);
  min-height: 1.5em;
  margin-bottom: var(--space-md);
}
.hero__term::after {
  content: "\2588"; /* block cursor */
  margin-left: 1px;
  animation: t4-blink 1s steps(1) infinite;
}

/* ---- Morphing background blob ---- */
.hero__blob {
  display: block;
  position: absolute;
  z-index: 0;
  top: -12%;
  right: -10%;
  width: min(58%, 640px);
  aspect-ratio: 1;
  pointer-events: none;
  /* soft plum cloud */
  background: linear-gradient(140deg, #443143 0%, #7a5680 55%, #4a3a6b 100%);
  opacity: 0.5;
  filter: blur(60px);
  border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%;
  /* two animations of different lengths => the shape rarely repeats */
  animation: t4-blob-morph 16s ease-in-out infinite,
    t4-blob-drift 27s ease-in-out infinite;
}
@media (max-width: 720px) {
  .hero__blob {
    width: 90%;
    right: -20%;
    filter: blur(48px);
    opacity: 0.45;
  }
}

/* ---- Keyword ticker ---- */
.site-ticker {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  background: var(--color-surface);
  border-block: 1px solid var(--color-border);
}
.site-ticker__track {
  display: inline-flex;
  width: max-content;
  animation: t4-ticker 38s linear infinite;
}
.site-ticker__group {
  display: inline-flex;
  align-items: center;
}
.site-ticker__item {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 0;
}
.site-ticker__item::before {
  content: "//";
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--plum);
  opacity: 0.5;
  margin-inline: 1.4rem;
}
.site-ticker__item .techlogo {
  width: 20px;
  height: 20px;
}
.site-ticker__item .techlogo-img {
  width: 20px;
  height: 20px;
  opacity: 0.4; /* 40% colour */
}
.site-ticker__name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-left: 0.55rem;
}

/* ---- Motion keyframes ---- */
@keyframes t4-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@keyframes t4-ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Blob: morph the border-radius through several organic shapes. */
@keyframes t4-blob-morph {
  0%, 100% { border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%; }
  20% { border-radius: 60% 40% 50% 50% / 60% 50% 50% 40%; }
  40% { border-radius: 45% 55% 35% 65% / 55% 38% 62% 45%; }
  60% { border-radius: 55% 45% 62% 38% / 40% 58% 42% 60%; }
  80% { border-radius: 42% 58% 48% 52% / 63% 47% 53% 37%; }
}

/* Blob: slowly rotate, scale and drift so it never quite repeats. */
@keyframes t4-blob-drift {
  0%, 100% { transform: rotate(0deg) scale(1) translate(0, 0); }
  25% { transform: rotate(9deg) scale(1.07) translate(-3%, 4%); }
  50% { transform: rotate(-6deg) scale(0.95) translate(4%, -3%); }
  75% { transform: rotate(5deg) scale(1.04) translate(-2%, -4%); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__blob { animation: none; }
  .site-ticker__track { animation: none; }
  .hero__term::after { animation: none; }
}

/* =========================================================
   MODE TOGGLE — Blueprint styling for the light/dark switch.
   Uses the Material Symbols glyphs to match the rest of the theme.
   ========================================================= */
.mode-toggle {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: var(--color-text-muted);
}
.mode-toggle:hover {
  color: var(--plum);
  border-color: var(--color-border-strong);
  background-color: var(--color-surface-hover);
}
.mode-toggle__icon {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 1.25rem;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga";
}
.mode-toggle__icon::before { content: "dark_mode"; }
html[data-mode="dark"] .mode-toggle__icon::before { content: "light_mode"; }

/* =========================================================
   DARK MODE — "Blueprint after dark"
   The same cool/plum system inverted onto a deep ink canvas.
   Activated by <html data-mode="dark"> (set by app.js / the
   no-flash bootstrap in index.html).
   ========================================================= */
html[data-mode="dark"] {
  --plum: #c8a6c6;          /* lightened so the accent reads on dark */
  --plum-hover: #d8bcd6;
  --bg: #131119;            /* cool near-black */
  --bg-2: #1a1822;
  --surface: #201d29;

  --color-bg: var(--bg);
  --color-bg-alt: var(--bg-2);
  --color-surface: var(--surface);
  --color-surface-hover: #29252f;
  --color-border: rgba(210, 184, 208, 0.12);
  --color-border-strong: rgba(210, 184, 208, 0.24);
  --color-text: #ece9f0;
  --color-text-muted: #a79fb0;
  --color-text-faint: #6f6878;
  --color-brand-deep: var(--plum);
  --color-accent: var(--plum);
  --color-accent-strong: var(--plum);
  --color-accent-glow: rgba(200, 166, 198, 0.16);
}

/* Canvas + faint top wash */
html[data-mode="dark"] body {
  background-color: var(--bg);
  background-image:
    radial-gradient(58% 42% at 50% -8%, rgba(200, 166, 198, 0.07), transparent 70%);
}

/* Glass header over the dark canvas (on the pseudo-element) */
html[data-mode="dark"] .site-header::before {
  background-color: rgba(19, 17, 25, 0.85);
}

/* Header wordmark: render white on the dark UI (footer logo keeps its own rule) */
html[data-mode="dark"] .site-header .brand__logo {
  filter: brightness(0) invert(1);
}

/* Primary button: the lightened-plum fill needs dark ink, not white */
html[data-mode="dark"] .btn--primary {
  color: #1b1620;
  box-shadow: 0 3px 10px -8px rgba(0, 0, 0, 0.6);
}
html[data-mode="dark"] .btn--primary:hover {
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.7);
}

/* Contact CTA: the lightened-plum fill needs dark ink, not white */
html[data-mode="dark"] .nav-cta,
html[data-mode="dark"] .nav-cta:hover {
  color: #1b1620;
  box-shadow: 0 3px 10px -8px rgba(0, 0, 0, 0.6);
}

/* CTA slab keeps a genuinely deep plum rather than following the light accent */
html[data-mode="dark"] .section--cta {
  background-color: #261c25;
  background-image: linear-gradient(180deg, #352736 0%, #211824 100%);
}
html[data-mode="dark"] .section--cta .eyebrow { color: #d9c7d6; }
html[data-mode="dark"] .channel:hover { color: #261c25; }

/* Tech-logo cells: a faint translucent-white wash on the dark canvas */
html[data-mode="dark"] .tech-logos__cell { background-color: #ffffff26; }
