@charset "UTF-8";

/* =========================================================================
   chippo.dev — v0.1 foundation
   Dark-first theme using CSS custom properties. Light theme via [data-theme].
   Static, dependency-free, system fonts only.
   ========================================================================= */

:root {
  /* Dark theme (default) */
  color-scheme: dark;
  --bg: #0b0e13;
  --bg-elev: #10151e;
  --surface: #151c28;
  --surface-2: #1b2433;
  --border: #243042;
  --text: #e6edf6;
  --muted: #9fb0c3;
  --accent: #2dd4bf;        /* teal */
  --accent-2: #38bdf8;      /* cyan */
  --on-accent: #04211d;
  --warn: #f5b86b;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.40);
  --focus: #5eead4;

  /* Hero visual panel + matrix (dark) */
  --hero-panel-bg: linear-gradient(160deg, #0c0f15, #090b10);
  --hero-panel-border: #151b25;
  --hero-panel-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  --matrix-color: #2dd4bf;
  --matrix-fade: 0, 0, 0;
  --matrix-opacity: 0.6;
  --matrix-ambient-opacity: 0.16;
  --matrix-word-opacity: 0.9;
  --matrix-glow-opacity: 1;
  --matrix-blend: screen;

  --radius: 14px;
  --maxw: 1080px;
  --gap: 1.25rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e9eef5;            /* soft blue-gray, not pure white */
  --bg-elev: #f2f6fb;
  --surface: #ffffff;
  --surface-2: #eaf0f8;
  --border: #d2dced;        /* subtle blue-gray */
  --text: #14213d;          /* dark navy / slate */
  --muted: #586a86;         /* slate-gray */
  --accent: #0d9488;        /* teal, a touch darker than dark mode */
  --accent-2: #0a6fb0;
  --on-accent: #ffffff;
  --warn: #b45309;
  --shadow: 0 18px 45px rgba(30, 50, 90, 0.12);
  --focus: #0d9488;

  /* Hero visual panel + matrix (light) — deeper slate-teal panel so the rain reads */
  --hero-panel-bg: linear-gradient(160deg, #c1d0d6, #a8bdc6);
  --hero-panel-border: #93a9b6;
  --hero-panel-shadow: 0 22px 50px rgba(30, 50, 90, 0.18);
  --matrix-color: #008f7a;
  --matrix-fade: 255, 255, 255;
  --matrix-opacity: 0.88;
  --matrix-ambient-opacity: 0.20;
  --matrix-word-opacity: 1;
  --matrix-glow-opacity: 1;
  --matrix-blend: multiply;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.container.narrow { max-width: 760px; }

/* Focus visibility (accessibility) */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
}
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); font-family: var(--mono); }
.brand-name { white-space: nowrap; }

.main-nav { margin-left: auto; }
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--muted);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  font-size: 0.95rem;
}
.main-nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }

.header-actions { display: inline-flex; align-items: center; gap: 0.5rem; }
.github-link {
  color: var(--muted);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  font-size: 0.95rem;
}
.github-link:hover { color: var(--text); background: var(--surface); text-decoration: none; }

.toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 36px;
  padding: 0 0.6rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 0.85rem;
  cursor: pointer;
}
.toggle-btn:hover { background: var(--surface-2); }
.theme-icon { font-size: 1.1rem; line-height: 1; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, white); }

/* ===== Hero ===== */
.hero { padding: 3.5rem 0 2.5rem; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--accent);
  font-family: var(--mono);
  margin-bottom: 0.75rem;
}
.hero-title { font-size: clamp(2rem, 5vw, 3rem); }
.hero-tagline { color: var(--muted); font-size: 1.15rem; margin-bottom: 1rem; }
.hero-body { max-width: 52ch; color: var(--text); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.25rem; }

/* Status panel */
.status-panel {
  background: linear-gradient(160deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: 0.9rem;
}
.status-head {
  color: var(--accent);
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.status-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.status-list li { display: flex; gap: 0.75rem; }
.status-list .k { color: var(--muted); min-width: 64px; }
.status-list .v { color: var(--text); }

/* ===== Sections ===== */
.section { padding: 2.75rem 0; border-top: 1px solid var(--border); }
.section-title { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.section-lead { color: var(--muted); max-width: 62ch; }

/* ===== Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
  margin-top: 1.5rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.card h3 { font-size: 1.05rem; }
.card p { color: var(--muted); margin: 0; }
.card.featured {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  margin-top: 1.5rem;
}

/* Pills */
.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.pill-accent { color: var(--on-accent); background: var(--accent); border-color: transparent; }
.pill-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); }

/* Contact */
.contact-list { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.contact-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }
.contact-list .k { font-family: var(--mono); color: var(--accent); min-width: 64px; }
.contact-list .note { color: var(--muted); font-size: 0.85rem; }

/* LIA (hidden in v0.1; styled for when enabled) */
.lia-section { background: var(--bg-elev); }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  background: var(--bg-elev);
}
.footer-inner { display: grid; gap: 0.35rem; }
.footer-inner .muted { color: var(--muted); font-size: 0.9rem; }
.muted { color: var(--muted); }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
  .status-panel { order: 2; }
  .main-nav { margin-left: 0; width: 100%; overflow-x: auto; }
  .main-nav ul { flex-wrap: nowrap; }
  .header-actions { margin-left: auto; }
}

/* ===== Polish: hero figure, matrix, terminal accent, featured visual ===== */

/* Subtle CSS terminal accent on the brand (no image, theme-aware) */
.brand-name::after {
  content: "▍";
  margin-left: 0.15rem;
  color: var(--accent);
  animation: blink-caret 1.1s steps(1) infinite;
}
@keyframes blink-caret { 50% { opacity: 0; } }

/* Hero composition */
.hero { padding: 4rem 0 3rem; }
.hero .container { max-width: 1140px; }          /* a touch more room for the hero */
.hero-inner {
  grid-template-columns: 1fr minmax(0, 560px);   /* give the visual column more width */
  gap: 2.25rem;
}
.hero-figure {
  position: relative;
  justify-self: end;                             /* hug the right edge on desktop */
  margin: 0;
  width: 100%;
  max-width: 560px;                              /* wider, dominant panel */
  height: 540px;                                 /* height stays ~ the same (no taller) */
  display: flex;
  align-items: stretch;
  justify-content: center;
  border: 1px solid var(--hero-panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--hero-panel-bg);
  box-shadow: var(--hero-panel-shadow);
}
.hero-img {
  position: relative;
  z-index: 1;                                    /* sits above the matrix margins */
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;                           /* no extra crop; CHIPPO .DEV sign kept */
  object-position: center;
}
/* Matrix canvas overlay — confined to the figure, edge-weighted mask so the
   rain frames the subject and fades over the centre. mix-blend keeps it light. */
.matrix-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: var(--matrix-opacity);
  mix-blend-mode: var(--matrix-blend);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 32%, #000 82%);
          mask-image: radial-gradient(ellipse at center, transparent 32%, #000 82%);
}

.hero-figure-tag {
  position: absolute;
  left: 0.75rem;
  bottom: 0.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  z-index: 3;
}

/* Status panel now lives in the hero left column */
.hero-content .status-panel { margin-top: 1.5rem; }

/* Featured case with side visual (key image) */
.featured-with-visual {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
}
.featured-visual { margin: 0; }
.featured-visual img {
  display: block;
  height: 150px;
  width: auto;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
}

/* Responsive behaviour for the new elements (matrix is desktop-only) */
@media (max-width: 820px) {
  .matrix-canvas { display: none; }
  .hero .container { max-width: 100%; }
  .hero-inner { grid-template-columns: 1fr; gap: 1.75rem; }   /* keep mobile stacking */
  .hero-figure {
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    height: 56vh;
    max-height: 440px;
  }
  .featured-with-visual { grid-template-columns: 1fr; }
  .featured-visual { justify-self: start; }
  .featured-visual img { height: 120px; }
}

/* ===== Back to top (floating, subtle, theme-aware) ===== */
.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--surface-2); color: var(--accent); }

@media (max-width: 820px) {
  .back-to-top { right: 0.9rem; bottom: 0.9rem; width: 40px; height: 40px; }
}

/* ===== Light theme polish (soft-light premium technical feel) ===== */
:root[data-theme="light"] body {
  background:
    radial-gradient(1100px 560px at 82% -8%, rgba(10, 111, 176, 0.10), transparent 60%),
    radial-gradient(820px 460px at -5% 2%, rgba(13, 148, 136, 0.08), transparent 55%),
    var(--bg);
}
:root[data-theme="light"] .site-header {
  background: color-mix(in srgb, #ffffff 82%, transparent);
}
:root[data-theme="light"] .hero {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 45%);
}
:root[data-theme="light"] .status-panel {
  background: linear-gradient(160deg, #ffffff, #e9f0fa);
  border-color: var(--border);
}
:root[data-theme="light"] .card {
  background: linear-gradient(180deg, #ffffff, #f5f9ff);
}
:root[data-theme="light"] .card.featured {
  background: linear-gradient(160deg, #ffffff, #e9f1fb);
}
:root[data-theme="light"] .btn { background: #ffffff; }
:root[data-theme="light"] .btn:hover { background: #eaf1fa; }
:root[data-theme="light"] .btn-primary {
  background: linear-gradient(180deg, #11a394, #0c8273);
  border-color: transparent;
}
/* hero-figure background/border/shadow are theme-driven via --hero-panel-* variables */
:root[data-theme="light"] .hero-figure-tag {
  background: color-mix(in srgb, #ffffff 70%, transparent);
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
