/* =========================================================
   STYLES: wireframe layout on top of a 3D scene.
   Deep navy night-sky theme for the whole page.
   ========================================================= */

   :root {
    --text: #e6ecff;
    --muted: #9aa8cc;
    --border: rgba(230, 236, 255, 0.18);
    --panel: rgba(20, 28, 70, 0.4);
    --nav-bg: rgba(10, 18, 50, 0.6);
    --light-blue: #8fd3ff;
    --accent: #7dd3fc;
    --font-body: "Manrope", system-ui, sans-serif;
    --font-round: "Varela Round", "Manrope", system-ui, sans-serif;
  }
  
  * { box-sizing: border-box; margin: 0; padding: 0; }
  
  html { scroll-behavior: smooth; scroll-padding-top: 54px; background: #0a1230; color-scheme: dark; }
  
  body {
    font-family: var(--font-body);
    color: var(--text);
    line-height: 1.6;
    overflow-x: clip;
    background: linear-gradient(#050818, #0f1a40) fixed;   /* fallback sky if 3D can't run */
  }
  body.has-3d { background: transparent; }
  
  /* =========================================================
     3D SCENE + OVERLAYS
     ========================================================= */
  #scene {
    position: fixed; inset: 0; width: 100%; height: 100%;
    z-index: -2; display: block;
  }
  #shooting-layer { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
  
  .shooting {
    position: absolute; width: var(--len, 140px); height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, #fff, rgba(200,215,255,0.5) 30%, rgba(255,255,255,0));   /* bright head, fading tail */
    box-shadow: 0 0 6px rgba(200,215,255,0.6);
    transform-origin: left center;
    rotate: var(--angle, -20deg);
    animation: shoot var(--dur, 1.1s) ease-in forwards;
  }
  @keyframes shoot {
    0%   { opacity: 0; translate: 0 0; }
    10%  { opacity: 1; }
    100% { opacity: 0; translate: var(--dx, -420px) var(--dy, 160px); }
  }
  
  /* Tooltip that follows the mouse over the brain badges */
  #tooltip {
    position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none;
    padding: 8px 12px; border-radius: 8px;
    background: rgba(10, 18, 50, 0.85); color: var(--text);
    font-size: 0.8rem; line-height: 1.4;
    opacity: 0; transition: opacity 0.15s;
    backdrop-filter: blur(6px);
  }
  #tooltip.show { opacity: 1; }
  #tooltip strong { color: #ffb86b; }
  
  /* Small pop-up message */
  #toast {
    position: fixed; left: 50%; bottom: 30px; z-index: 50;
    transform: translate(-50%, 30px); opacity: 0;
    padding: 14px 22px; border-radius: 12px; max-width: min(90vw, 420px); text-align: center;
    background: rgba(10, 18, 50, 0.9); color: var(--text);
    transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34, 1.6, 0.64, 1);
  }
  #toast.show { opacity: 1; transform: translate(-50%, 0); }
  
  /* =========================================================
     NAV
     ========================================================= */
  .nav {
    position: fixed; top: 0; left: 0; right: 0; height: 54px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 40px;
    background: var(--nav-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    z-index: 10;
  }
  .nav-links { display: flex; gap: 20px; list-style: none; margin-left: 48px; }   /* links on the left, nudged in */
  .nav-links a {
    color: var(--text); text-decoration: none; font-size: 0.85rem;
    transition: color 0.2s, text-shadow 0.2s;
  }
  .nav-links a:hover { color: var(--accent); text-shadow: 0 0 8px rgba(125, 211, 252, 0.6); }
  .nav-links a.active { color: var(--accent); }
  
  /* mail / LinkedIn / GitHub icons, in a row on the right */
  .nav-social { display: flex; align-items: center; gap: 18px; margin-left: auto; margin-right: 8px; }
  .nav-social a {
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text); line-height: 1;
    transition: color 0.2s, transform 0.2s;
  }
  .nav-social a:hover { color: var(--accent); transform: translateY(-2px); }
  .nav-social svg { width: 18px; height: 18px; display: block; }
  
  /* =========================================================
     SECTIONS
     ========================================================= */
  .section {
    max-width: 1000px;
    margin: 0;                 /* content sits on the left, lined up with the nav links */
    padding: 100px 40px;
    border-bottom: 1px dashed var(--border);
  }
  
  /* Section titles: "/ Who am I?" (the slash is added by script.js) */
  .section-title {
    display: flex; align-items: center; gap: 10px; margin-bottom: 36px;
    font-family: var(--font-round); font-weight: 400; letter-spacing: -0.01em;
    font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.05; text-wrap: balance;
    color: var(--text);
  }
  .section-slash { flex: none; }
  .section-heading-text { flex: 1; min-width: 0; }
  
  /* ---------- Hero: "hi, Carol here." ---------- */
  .hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 28px; position: relative; }
  .hero-name {
    font-family: var(--font-round); font-weight: 400; letter-spacing: -0.01em;
    font-size: clamp(2.8rem, 6.4vw, 5.6rem); line-height: 1.05; color: var(--text);
  }
  .name-accent { color: var(--light-blue); }
  .caret {
    display: inline-block; width: 0.07em; height: 0.85em; margin-left: 0.08em; vertical-align: -0.04em;
    background: var(--light-blue); border-radius: 2px;
    animation: blink 1s steps(1) infinite;
  }
  @keyframes blink { 50% { opacity: 0; } }
  .hero-intro { font-size: clamp(1rem, 1.6vw, 1.25rem); line-height: 1.85; max-width: 44ch; color: var(--muted); }
  .hero .hint { margin-top: 20px; }
  .scroll-cue {
    position: absolute; left: 40px; bottom: 32px;
    display: flex; align-items: center; gap: 10px;
    font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); text-decoration: none;
  }
  .scroll-cue::before {
    content: ""; width: 1px; height: 44px; background: linear-gradient(transparent, #ffb86b);
    animation: drip 2s ease-in-out infinite; transform-origin: top;
  }
  @keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
  
  /* =========================================================
     REUSABLE PIECES
     ========================================================= */
  .center { text-align: center; }
  .label { font-size: 0.85rem; color: var(--muted); }
  
  .button {
    display: inline-block; align-self: flex-start;
    margin-top: 16px; padding: 12px 24px;
    border: 1px solid var(--text); color: var(--text); text-decoration: none;
    background: var(--panel); backdrop-filter: blur(4px);
  }
  .button.say-hi {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 16px 30px; border-radius: 6px;
    border: 1.5px solid var(--light-blue); color: var(--light-blue);
    background: transparent; font-weight: 600; font-size: 1rem;
    transition: background 0.2s, transform 0.2s;
  }
  .button.say-hi svg { width: 26px; height: 26px; }
  .button.say-hi:hover { background: rgba(143, 211, 255, 0.1); transform: translateY(-2px); }
  
  /* Placeholder box (for project images until you add real ones) */
  .box {
    background: var(--panel);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 0.85rem;
    min-height: 150px;
    backdrop-filter: blur(4px);
  }
  .thumb { min-height: 120px; margin-bottom: 12px; }
  
  /* Highlighted words */
  .hl { color: var(--accent); font-weight: 600; }
  .distinction { color: var(--accent); font-weight: 800; white-space: nowrap; }
  
  /* Lists with glowing tech arrows */
  .list-intro { margin-top: 18px; color: var(--muted); }
  .list { list-style: none; padding-left: 0; margin-top: 10px; }
  .list li { position: relative; padding-left: 1.6rem; margin: 8px 0; }
  .list li::before {
    content: "▹";
    position: absolute; left: 0; top: 0;
    color: var(--accent); font-size: 1.05rem; line-height: 1.52;
    font-family: var(--font-body);
    text-shadow: 0 0 6px rgba(125, 211, 252, 0.8), 0 0 14px rgba(125, 211, 252, 0.35);
    transition: transform 0.2s;
  }
  .list li:hover::before { transform: translateX(4px); }
  /* the skills list: two columns in a code-style font */
  .tech-list { display: grid; grid-template-columns: repeat(2, minmax(140px, 220px)); gap: 4px 28px; margin-top: 12px; }
  .tech-list li { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 1rem; color: var(--text); }
  
  /* =========================================================
     LAYOUTS
     ========================================================= */
  .two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; align-items: center; }
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
  .card {
    border: 1px solid var(--border); padding: 20px;
    background: var(--panel); backdrop-filter: blur(6px);
  }
  footer { padding: 30px; }
  footer .credit { margin-top: 8px; font-size: 0.75rem; }
  footer .credit a { color: inherit; }
  
  /* 3D tilt on cards (class added by script.js) */
  .tilt {
    position: relative; overflow: hidden;
    transition: transform 0.15s ease-out, box-shadow 0.2s;
    will-change: transform;
  }
  .tilt:hover { box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.45); }
  .tilt::after {           /* light glare that follows the mouse */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,0.12), transparent 45%);
    opacity: 0; transition: opacity 0.2s;
  }
  .tilt:hover::after { opacity: 1; }
  
  /* Sections fade in on scroll (class added by script.js) */
  .reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s, transform 0.6s; }
  .reveal.visible { opacity: 1; transform: none; }
  
  /* =========================================================
     "WHO AM I?" PHOTO
     ========================================================= */
  .photo {
    justify-self: center; align-self: center;    /* centred in its column */
    width: min(100%, 250px); aspect-ratio: 1; margin: 0;
  }
  .photo img {
    display: block; width: 100%; height: 100%; object-fit: cover;
    border-radius: 12px; filter: grayscale(25%) brightness(0.95);
    transition: filter 0.3s;
  }
  .photo:hover img { filter: none; }
  
  /* =========================================================
     "WHERE HAVE I WORKED?": company tabs + experience card
     ========================================================= */
  .xp { display: flex; gap: 28px; align-items: flex-start; max-width: 860px; }
  .xp-tabs { position: relative; display: flex; flex-direction: column; flex: none; border-left: 2px solid var(--border); }
  .xp-tab {
    background: none; border: none; cursor: pointer; text-align: left; white-space: nowrap;
    font: 500 0.92rem var(--font-body); color: var(--muted);
    padding: 12px 20px; transition: color 0.2s, background 0.2s;
  }
  .xp-tab:hover { color: var(--accent); background: rgba(125, 211, 252, 0.06); }
  .xp-tab.active { color: var(--accent); }
  .xp-tab:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }
  .xp-indicator {                                   /* glowing bar that slides to the open company */
    position: absolute; left: -2px; top: 0; width: 2px; height: 44px;
    background: var(--accent); box-shadow: 0 0 10px rgba(125, 211, 252, 0.8);
    transition: transform 0.3s ease, height 0.3s ease;
  }
  .xp-panels { flex: 1; min-width: 0; }
  .xp-panel {
    border: 1px solid var(--border); border-radius: 10px; padding: 22px 24px;
    background: var(--panel); backdrop-filter: blur(6px);
    animation: xpIn 0.35s ease;
  }
  @keyframes xpIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .xp-panel h3 { font-size: 1.15rem; font-weight: 600; line-height: 1.35; }
  .xp-meta { font-size: 0.82rem; color: var(--muted); margin-top: 4px; letter-spacing: 0.02em; }
  .xp-about { font-size: 0.85rem; color: var(--muted); font-style: italic; margin-top: 6px; }
  .xp-list { margin-top: 14px; }
  .xp-list li { font-size: 0.88rem; line-height: 1.6; color: var(--text); margin: 9px 0; }
  .xp-list li::before { line-height: 1.34; }
  .xp-list a { color: var(--accent); text-underline-offset: 3px; white-space: nowrap; }
  
  /* =========================================================
     "WHAT DO I CREATE?": drawings, lightbox, book
     ========================================================= */
  .art-intro { color: var(--muted); max-width: 52ch; }
  .art-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;   /* 6 drawings = two even rows of 3 */
    margin-top: 24px; max-width: 640px;
  }
  .art-piece { margin: 0; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden;
    border: 1px solid var(--border); background: #e9e6df; }
  .art-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; cursor: zoom-in; background: none; }
  .art-open img { width: 100%; height: 100%; object-fit: cover; display: block;
    filter: grayscale(15%) contrast(1.05); transition: transform 0.4s, filter 0.3s; }
  .art-piece:hover { border-color: var(--accent); box-shadow: 0 0 18px rgba(125, 211, 252, 0.3); }
  .art-piece:hover img { transform: scale(1.05); filter: none; }
  .art-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  
  .lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
    background: rgba(5, 8, 24, 0.92); backdrop-filter: blur(6px); }
  .lightbox[hidden] { display: none; }
  .lightbox img { max-width: min(88vw, 900px); max-height: 86vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
  .lightbox button { position: absolute; background: none; border: 0; color: var(--text); cursor: pointer; font-size: 2.6rem; line-height: 1; padding: 12px; }
  .lightbox button:hover { color: var(--accent); }
  .lb-close { top: 16px; right: 22px; }
  .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
  .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
  
  .book {
    display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: center;
    margin-top: 40px; max-width: 640px; padding: 20px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--panel); backdrop-filter: blur(6px);
  }
  .book-cover { width: 100%; aspect-ratio: 7 / 8; object-fit: cover; object-position: center bottom; border-radius: 8px; display: block;
    transition: transform 0.4s; }
  .book:hover .book-cover { transform: scale(1.03); }
  .book-kicker { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
  .book-title { font-family: "Courier New", "Courier", ui-monospace, monospace; font-weight: 400;
    font-size: 2.2rem; line-height: 1.1; margin-top: 6px; color: #f3f6ff; }
  .book-by { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
  .book-blurb { margin-top: 14px; font-size: 0.92rem; line-height: 1.7; }
  .book-link { margin-top: 18px; border-color: var(--accent); color: var(--accent); border-radius: 6px; }
  
  /* =========================================================
     SMALLER SCREENS
     ========================================================= */
  @media (max-width: 900px) {
    .art-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 800px) {
    .nav { padding: 0 16px; }
    .nav-links { display: none; margin-left: 0; }       /* add a hamburger menu later */
    .section { padding-left: 16px; padding-right: 16px; }
    .two-col { grid-template-columns: 1fr; }
    .photo { margin-top: 24px; }
    .xp { flex-direction: column; }
    .xp-tabs { flex-direction: row; border-left: none; border-bottom: 2px solid var(--border); overflow-x: auto; width: 100%; }
    .xp-indicator { display: none; }
    .xp-tab.active { box-shadow: inset 0 -2px 0 var(--accent); }
  }
  @media (max-width: 700px) {
    .book { grid-template-columns: 1fr; }
  }
  
  /* Respect people who turn off animations */
  @media (prefers-reduced-motion: reduce) {
    .caret, .scroll-cue::before, .xp-panel { animation: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .tilt, .xp-indicator, .photo img { transition: none; }
  }
  /* ---------- Footer ---------- */
.footer {
  text-align: center; padding: 40px 20px 32px;
  border-top: 1px solid var(--border);
}
.footer-main { font-size: 0.9rem; color: var(--text); }
.footer-credit { margin-top: 6px; font-size: 0.72rem; color: var(--muted); opacity: 0.75; }
.footer-credit a { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.footer-credit a:hover { color: var(--accent); }
.coming-soon { color: var(--muted); font-size: 0.9rem; font-style: italic; }