@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;1,8..60,300;1,8..60,400&display=swap');

@font-face {
  font-family: 'APK Praktikal';
  src: url('APK-Praktikal-Book-Trial.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:    #111010;
  --fg:    #f2ede6;
  --muted: #555;
  --dim:   #363636;
  --tl-w:  64px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'APK Praktikal', monospace;
  overflow: hidden;
  height: 100vh;
}

/* ─── SITE HEADER ─── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.logo-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
  display: block;
}

/* browser-tab decoration top-right */
.tab-deco {
  position: fixed;
  top: 0; right: 36px;
  background: #252525;
  border-radius: 0 0 9px 9px;
  padding: 11px 18px 9px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 100;
}
.tab-deco i {
  display: block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #444;
}

/* ─── LEFT TIMELINE ─── */
.timeline-nav {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--tl-w);
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 20px;
}

.era-entry {
  cursor: pointer;
  padding: 5px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.era-entry .era-label-tag {
  font-family: 'APK Praktikal', monospace;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.35s ease;
  white-space: nowrap;
  line-height: 1.3;
}

.era-entry.active .era-label-tag {
  max-height: 20px;
  opacity: 1;
  margin-bottom: 5px;
}

.era-tick {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--dim);
  transition: width 0.3s, background 0.3s;
}

.era-entry.active .era-tick {
  width: 26px;
  background: var(--fg);
}

.era-entry:hover .era-tick { background: #888; }

/* ─── SCROLL CONTAINER ─── */
.site-main {
  position: fixed;
  top: 0;
  left: var(--tl-w);
  right: 0;
  bottom: 0;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}
.site-main::-webkit-scrollbar { display: none; }
.site-main { -ms-overflow-style: none; scrollbar-width: none; }

/* ─── ERA SECTIONS ─── */
.era-section {
  position: relative;
  width: 100%;
  height: 100vh;
  scroll-snap-align: start;
  overflow: hidden;
}

/* ─── NOW SECTION ─── */

/* art stage: full section, all images inside here */
.art-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* hero text: centered over everything */
.hero-text-block {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  text-align: center;
  width: 100%;
  padding: 0 40px;
  pointer-events: none;
}

.display-heading {
  font-family: 'APK Praktikal', monospace;
  font-size: clamp(38px, 5.6vw, 82px);
  line-height: 1.1;
  color: var(--fg);
  letter-spacing: 0.025em;
  text-transform: uppercase;
  font-weight: 400;
}

/* bio: pinned to bottom center */
.hero-bio {
  position: absolute;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  text-align: center;
  width: 460px;
  pointer-events: none;
  color: #fff;
  font-family: 'Source Serif 4', serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 300;
  line-height: 150%;
  letter-spacing: -0.16px;
  font-feature-settings: 'dlig' on, 'salt' on;
}

/* ─── BROWSER FRAME COMPONENT ─────────────────────────────────────────
   Usage:
     <div class="browser-frame af1" style="--chrome: #4B6EE6;">
       <div class="b-chrome"><span class="b-dot"></span>×3</div>
       <img class="b-image" src="painting.jpg" alt="">
     </div>

   • Set --chrome on the element to pick the bar colour.
   • Drop any raw image in as .b-image — height stays auto,
     so the frame wraps the image's natural aspect ratio.
   • Use .b-placeholder (with --ratio and --ph vars) until
     a real image is available.
──────────────────────────────────────────────────────────────────── */

.browser-frame {
  position: absolute;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.05);
  pointer-events: all;
  transition: box-shadow 0.25s ease;
}

.browser-frame:hover {
  box-shadow: 0 28px 70px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.12);
  z-index: 30 !important;
}

/* coloured chrome bar */
.b-chrome {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 11px;
  background: var(--chrome, #555);
}

/* traffic light dots — translucent white by default */
.b-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.38);
  flex-shrink: 0;
}

/* macOS exact traffic light colours (opt-in) */
.b-chrome--macos .b-dot:nth-child(1) { background: #FF5F57; }
.b-chrome--macos .b-dot:nth-child(2) { background: #FEBC2E; }
.b-chrome--macos .b-dot:nth-child(3) { background: #28C840; }

/* painting image — full width, auto height = aspect ratio preserved */
.b-image {
  display: block;
  width: 100%;
  height: auto;
}

/* placeholder until real image is supplied */
.b-placeholder {
  width: 100%;
  aspect-ratio: var(--ratio, 4/3);
  background: var(--ph, #2a2a2a);
}

/* ── frame positions (right-side only, all left-edges > 50vw) ── */
.af1 { width: 18vw; right:  1vw; top:  3vh; z-index: 10; transform: rotate(-1deg);   } /* folk art       */
.af2 { width: 12vw; right: 20vw; top:  1vh; z-index:  8; transform: rotate(2deg);    } /* cassi card     */
.af3 { width: 22vw; right: 20vw; top: 34vh; z-index: 12; transform: rotate(0.4deg);  } /* money stacks   */
.af4 { width: 20vw; right:  1vw; top: 44vh; z-index: 11; transform: rotate(-1.5deg); } /* portrait face  */
.af5 { width: 16vw; right: 23vw; top: 60vh; z-index:  9; transform: rotate(1.8deg);  } /* clock          */
.af6 { width: 20vw; right: 26vw; top:  5vh; z-index:  7; transform: rotate(-2deg);   } /* stripes        */
.af7 { width: 18vw; right:  2vw; top: 68vh; z-index:  9; transform: rotate(1deg);    } /* scream         */
.af8 { width: 11vw; right: 33vw; top: 26vh; z-index:  6; transform: rotate(-1.5deg); } /* cassi home     */
.af9 { width: 15vw; right: 27vw; top: 52vh; z-index:  8; transform: rotate(1.5deg);  } /* rugs           */

/* ─── OTHER ERA SECTIONS ─── */
.era-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 60px;
  gap: 20px;
}

.era-season {
  font-family: 'APK Praktikal', monospace;
  font-size: clamp(28px, 3.8vw, 56px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  opacity: 0.12;
  line-height: 1;
  user-select: none;
}

.era-note {
  font-family: 'Source Serif 4', serif;
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.8;
}

.era-dot-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.era-dot-row span {
  display: block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--dim);
}

/* ─── BLOG PAGE ─── */
.blog-wrap {
  position: fixed;
  top: 60px;
  left: var(--tl-w);
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.article-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 500px;
  padding: 40px 0;
}

.article-link {
  font-family: 'Source Serif 4', serif;
  font-size: 13px;
  font-style: italic;
  color: var(--fg);
  opacity: 0.55;
  text-decoration: none;
  padding: 13px 0;
  border-bottom: 1px solid #1c1c1c;
  letter-spacing: 0.01em;
  transition: opacity 0.2s, padding-left 0.2s;
  display: block;
}

.article-link:first-child { border-top: 1px solid #1c1c1c; }

.article-link:hover {
  opacity: 1;
  padding-left: 10px;
}

/* ─── ARTICLE PAGE ─── */
.article-wrap {
  position: fixed;
  top: 60px;
  left: var(--tl-w);
  right: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 52px 80px;
}

.article-back {
  font-family: 'APK Praktikal', monospace;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 52px;
  transition: color 0.2s;
}

.article-back:hover { color: var(--fg); }

.article-title {
  font-family: 'APK Praktikal', monospace;
  font-size: clamp(18px, 2.4vw, 30px);
  line-height: 1.4;
  color: var(--fg);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  max-width: 580px;
  margin-bottom: 28px;
  font-weight: 400;
}

.article-date {
  font-family: 'APK Praktikal', monospace;
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 52px;
}

.article-body {
  font-family: 'Source Serif 4', serif;
  font-size: 13px;
  line-height: 2;
  color: var(--fg);
  opacity: 0.7;
  max-width: 580px;
}

.article-body p { margin-bottom: 26px; }

/* ─── SHARED BLOG/ARTICLE NAV ─── */
.page-left-nav {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--tl-w);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 20px;
  gap: 18px;
  z-index: 50;
}

.page-nav-item {
  font-family: 'APK Praktikal', monospace;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.page-nav-item:hover,
.page-nav-item.active { color: var(--fg); }
