/* ==========================================================
   Zieron Jacinto portfolio
   One page, read top to bottom as a cross-section:
   sky -> city -> underground rail -> fossils -> bedrock
   ========================================================== */

   :root {
    /* sky */
    --sky-top: #5fa8e8;
    --sky-low: #bfe0f7;
    --sky-glow: #ffe3b8;
    /* city */
    --dusk: #22304f;
    --dusk-deep: #162038;
    --window: #ffd36b;
    /* underground */
    --tunnel: #1f1b1a;
    --tunnel-lit: #2c2624;
    --signal: #3fd0b4;
    --steel: #8a8f94;
    /* fossils */
    --sand-1: #d6b88a;
    --sand-2: #b98f60;
    --sand-3: #8f6a44;
    --bone: #f1e8d2;
    /* bedrock */
    --rock: #14100e;
  
    --ink-light: #f6f3ec;
    --ink-dark: #1b2233;
  
    --display: "Bricolage Grotesque", system-ui, sans-serif;
    --body: "Newsreader", Georgia, serif;
    --max: 1040px;
  }
  
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    font-family: var(--body);
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--ink-light);
    background: var(--rock);
    overflow-x: hidden;
  }
  h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; }
  p { margin: 0 0 1rem; max-width: 60ch; }
  a { color: inherit; }
  :focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
  
  .wrap { width: min(var(--max), 100% - 3rem); margin-inline: auto; position: relative; z-index: 2; }
  .layer { position: relative; overflow: hidden; }
  h2 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 1.5rem; }
  .sub { font-size: 1.25rem; opacity: .85; }
  
  .btn {
    display: inline-block;
    font-family: var(--display);
    font-weight: 700;
    text-decoration: none;
    padding: .85rem 1.5rem;
    border-radius: 999px;
    background: var(--ink-dark);
    color: #fff;
    transition: transform .2s ease, background .2s ease;
  }
  .btn:hover { transform: translateY(-2px); background: #2f3d63; }
  
  /* ---------- depth gauge ---------- */
  .gauge {
    position: fixed; right: 1rem; top: 50%; transform: translateY(-50%);
    z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: .75rem;
    font-family: var(--display); font-size: .85rem;
    mix-blend-mode: normal;
  }
  .gauge-readout {
    background: rgba(10, 12, 20, .72); color: #fff; padding: .35rem .7rem; border-radius: 999px;
    font-weight: 700; backdrop-filter: blur(6px);
  }
  .gauge ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
  .gauge a {
    display: flex; align-items: center; justify-content: flex-end; gap: .5rem;
    text-decoration: none; color: #fff;
  }
  .gauge a span {
    background: rgba(10, 12, 20, .72); padding: .2rem .6rem; border-radius: 999px;
    opacity: 0; transform: translateX(6px); transition: .2s; backdrop-filter: blur(6px);
  }
  .gauge a::after {
    content: ""; width: 12px; height: 12px; border-radius: 50%;
    background: rgba(255,255,255,.4); border: 2px solid rgba(10,12,20,.7); transition: .2s;
  }
  .gauge a:hover span, .gauge a:focus-visible span, .gauge a.active span { opacity: 1; transform: none; }
  .gauge a.active::after { background: var(--signal); transform: scale(1.3); }
  
  /* ---------- 1. sky ---------- */
  .sky {
    min-height: 100vh;
    display: flex; align-items: center;
    background: linear-gradient(to bottom, var(--sky-top) 0%, var(--sky-low) 62%, var(--sky-glow) 100%);
    color: var(--ink-dark);
    padding-bottom: 9rem;
  }
  .sun {
    position: absolute; right: 14%; top: 14%;
    width: clamp(110px, 16vw, 210px); aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle, #fffbe6 0 45%, #ffe9a8 46% 100%);
    box-shadow: 0 0 80px 40px rgba(255, 236, 170, .55);
    will-change: transform;
  }
  .clouds { position: absolute; inset: 0; pointer-events: none; }
  .cloud {
    position: absolute; display: block; height: 46px; width: 150px; border-radius: 999px;
    background: #fff; opacity: .92;
    filter: drop-shadow(0 8px 10px rgba(60, 100, 150, .12));
    animation: drift linear infinite; will-change: transform;
  }
  .cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
  .cloud::before { width: 70px; height: 70px; left: 24px; top: -34px; }
  .cloud::after  { width: 52px; height: 52px; left: 78px; top: -22px; }
  .c1 { top: 18%; left: -200px; animation-duration: 95s; }
  .c2 { top: 34%; left: -300px; animation-duration: 130s; animation-delay: -40s; transform: scale(1.4); }
  .c3 { top: 12%; left: -250px; animation-duration: 160s; animation-delay: -90s; transform: scale(.8); }
  .c4 { top: 46%; left: -200px; animation-duration: 110s; animation-delay: -20s; transform: scale(.7); }
  @keyframes drift { to { margin-left: calc(100vw + 500px); } }
  
  .plane {
    position: absolute; top: 20%; left: 0; z-index: 1; pointer-events: none;
    width: clamp(180px, 24vw, 300px);
    transform: translateX(-110%);
    animation: fly 20s cubic-bezier(.3,.1,.5,1) 1s infinite; /* about 4s of flight, then a pause */
    will-change: transform;
  }
  .plane svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 8px rgba(40, 80, 130, .18)); }
  @keyframes fly {
    0%   { transform: translate(-110%, 0) rotate(-1.5deg); }
    20%  { transform: translate(100vw, -60px) rotate(-1.5deg); }
    100% { transform: translate(100vw, -60px) rotate(-1.5deg); }
  }
  
  .hero-copy { padding-block: 6rem 2rem; }
  .kicker { font-family: var(--display); font-weight: 700; margin-bottom: .75rem; }
  h1 {
    font-size: clamp(4rem, 14vw, 10rem); font-weight: 800; letter-spacing: -0.04em;
    margin-bottom: 1.5rem; color: var(--ink-dark);
  }
  .lead { font-size: 1.35rem; margin-bottom: 2rem; }
  
  
  /* ---------- 2. city ---------- */
  .city {
    /* dusk sky above the rooftops (first 360px), then the building facade */
    background:
      linear-gradient(to bottom, #ffe3b8 0, #f9c28f 110px, #ee9f90 220px, #a77fa8 330px, #1c2543 360px) top / 100% 360px no-repeat,
      #1c2543;
    padding: 27rem 0 0;
    margin-top: -1px;
    overflow: visible; /* lets the tallest towers rise into the hero sky */
  }
  .skyline-stack {
    position: absolute; left: 0; width: 100%; top: -200px; height: 560px;
    z-index: 1; pointer-events: none;
    clip-path: inset(-400px 0 0 0); /* clip the bottom only, so parallax layers never spill onto the facade */
  }
  .sk { position: absolute; inset: 0; width: 100%; height: 100%; display: block; will-change: transform; }
  .facade { position: absolute; left: 0; width: 100%; top: 360px; bottom: 150px; z-index: 0; pointer-events: none; }
  .beacon { animation: blink 2.6s ease-in-out infinite; }
  @keyframes blink { 0%, 60%, 100% { opacity: .15; } 30% { opacity: 1; } }
  .two-col { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 3rem; align-items: start; }
  .portrait {
    aspect-ratio: 4 / 5; border-radius: 6px;
    background: repeating-linear-gradient(135deg, #2e3d63 0 14px, #34456f 14px 28px);
    display: grid; place-items: center; text-align: center;
    font-family: var(--display); color: #b9c6e8;
    border: 2px dashed #5a6ea3;
  }
  .facts { margin: 2rem 0 0; display: grid; gap: .75rem; }
  .facts div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; border-top: 1px solid rgba(255,255,255,.18); padding-top: .75rem; }
  .facts dt { font-family: var(--display); font-weight: 700; color: var(--window); }
  .facts dd { margin: 0; }
  .street { margin-top: 9rem; height: 150px; position: relative; z-index: 2; }
  .street-svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 270px; display: block; }
  
  /* ---------- 3. underground rail ---------- */
  .metro {
    background:
      radial-gradient(ellipse at 50% 0%, #3a302c 0, transparent 60%),
      linear-gradient(to bottom, #3e2f26 0, var(--tunnel) 160px, var(--tunnel) 100%);
    padding: 5rem 0 6rem;
  }
  .metro::before { /* tunnel ceiling lamps */
    content: ""; position: absolute; left: 0; right: 0; top: 190px; height: 6px;
    background: repeating-linear-gradient(90deg, #ffe9a8 0 60px, transparent 60px 220px);
    opacity: .5; filter: blur(3px);
  }
  .line { position: relative; margin-top: 5rem; }
  .stations {
    list-style: none; margin: 0; padding: 0 1.5rem 0;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem;
    width: min(var(--max), 100%); margin-inline: auto; position: relative; z-index: 2;
  }
  .station {
    background: var(--tunnel-lit);
    border-top: 4px solid var(--signal);
    border-radius: 0 0 10px 10px;
    padding: 1.25rem 1.25rem 1rem;
    position: relative;
  }
  .station::before { /* platform marker on the track */
    content: ""; position: absolute; top: -24px; left: 1.25rem;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--tunnel); border: 4px solid var(--signal);
  }
  .station h3 { font-size: 1.35rem; margin-bottom: .6rem; }
  .station ul { margin: 0; padding-left: 1.1rem; font-size: 1rem; line-height: 1.7; opacity: .9; }
  
  .track { position: absolute; left: 0; right: 0; top: -17px; height: 14px; z-index: 1; }
  .rail { position: absolute; left: 0; right: 0; top: 4px; height: 4px; background: var(--steel); box-shadow: 0 5px 0 var(--steel); }
  .ties {
    position: absolute; left: 0; right: 0; top: 12px; height: 6px;
    background: repeating-linear-gradient(90deg, #5b4636 0 14px, transparent 14px 34px);
  }
  .train {
    position: absolute; top: -78px; left: 0; display: flex; gap: 4px; z-index: 3; will-change: transform;
  }
  .car {
    width: 120px; height: 56px; border-radius: 10px 10px 4px 4px; position: relative;
    background: linear-gradient(to bottom, #e9edf0 0 70%, var(--signal) 70% 82%, #cfd6da 82%);
  }
  .car::before { /* windows */
    content: ""; position: absolute; left: 10px; right: 10px; top: 10px; height: 18px;
    background: repeating-linear-gradient(90deg, #26323a 0 22px, transparent 22px 30px);
    border-radius: 3px;
  }
  .car::after { /* wheels */
    content: ""; position: absolute; left: 14px; right: 14px; bottom: -6px; height: 10px;
    background: radial-gradient(circle, #111 0 4px, transparent 5px) 0 0 / 30px 10px repeat-x;
  }
  .lead-car { border-radius: 10px 36px 4px 4px; width: 138px; }
  .lead-car::before { right: 34px; }
  
  /* ---------- 4. fossils ---------- */
  .fossils {
    background: linear-gradient(to bottom, var(--tunnel) 0, #3e2f26 140px, var(--sand-3) 320px, var(--sand-3) 100%);
    padding: 8rem 0 0;
  }
  .strata { display: grid; margin-top: 2rem; }
  .stratum {
    position: relative;
    display: grid; grid-template-columns: 150px 1fr; gap: 2rem; align-items: center;
    padding: 3rem max(1.5rem, calc((100% - var(--max)) / 2));
    margin-inline: calc(50% - 50vw);
    color: #2b1f14;
  }
  .stratum h3 { font-size: 1.5rem; margin-bottom: .25rem; }
  .meta { font-family: var(--display); font-weight: 700; opacity: .75; margin-bottom: .5rem; }
  .fossil { width: 150px; color: var(--bone); opacity: .9; filter: drop-shadow(0 2px 0 rgba(0,0,0,.25)); }
  .s1 { background: var(--sand-1); clip-path: polygon(0 0, 100% 2.5rem, 100% 100%, 0 calc(100% - 1.5rem)); }
  .s2 { background: var(--sand-2); margin-top: -2.5rem; padding-top: 5rem; clip-path: polygon(0 1.5rem, 100% 0, 100% 100%, 0 calc(100% - 2rem)); }
  .s3 { background: var(--sand-3); margin-top: -2rem; padding-top: 5rem; padding-bottom: 6rem; color: var(--ink-light);
        clip-path: polygon(0 2rem, 100% 0, 100% 100%, 0 100%); }
  .s3 .fossil { color: #d9c9a6; }
  
  /* ---------- 5. bedrock ---------- */
  .bedrock {
    background:
      radial-gradient(circle at 20% 30%, rgba(255,255,255,.04) 0 2px, transparent 3px) 0 0 / 70px 70px,
      linear-gradient(to bottom, var(--sand-3) 0, #3b2b1f 120px, var(--rock) 360px);
    padding: 9rem 0 3rem;
    margin-top: -2px;
  }
  .contact-list { list-style: none; margin: 2.5rem 0 4rem; padding: 0; max-width: 640px; }
  .contact-list li {
    display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; align-items: baseline;
    padding: 1rem 0; border-top: 1px solid rgba(255,255,255,.15);
  }
  .contact-list span { font-family: var(--display); font-weight: 700; color: var(--signal); }
  .contact-list a { font-size: 1.3rem; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s; }
  .contact-list a:hover { border-bottom-color: var(--signal); }
  .foot { opacity: .55; font-size: .95rem; }
  
  /* ---------- responsive ---------- */
  @media (max-width: 860px) {
    .two-col { grid-template-columns: 1fr; }
    .portrait { max-width: 240px; }
    .stations { grid-template-columns: 1fr 1fr; padding-top: 1rem; }
    .stratum { grid-template-columns: 90px 1fr; gap: 1rem; }
    .fossil { width: 90px; }
    .gauge ul { display: none; }
  }
  @media (max-width: 520px) {
    .stations { grid-template-columns: 1fr; }
    .facts div, .contact-list li { grid-template-columns: 1fr; gap: .1rem; }
  }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .cloud, .beacon { animation: none; }
    .plane { display: none; }
  }