:root {
  --pink: #e0368f;
  --pink-soft: #f6c6ec;
  --ink: #2a1630;
  --bg1: #1b1020;
  --bg2: #e9e4ee;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(120% 90% at 50% 100%, #f3eef6 0%, #cfc6d8 45%, #3a2440 85%, var(--bg1) 100%);
}

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.top {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 28px 36px; pointer-events: none; color: #fff;
}
.brand { display: flex; flex-direction: column; gap: 4px; }
.brand-name { font-family: "Silkscreen", monospace; font-size: 22px; letter-spacing: 0.02em; }
.brand-role { font-size: 13px; opacity: 0.7; }
nav { display: flex; gap: 8px; pointer-events: auto; }
nav button {
  font: 500 13px "Inter", sans-serif; color: #fff; cursor: pointer;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.25);
  padding: 8px 16px; border-radius: 999px; backdrop-filter: blur(8px);
  transition: background .2s, color .2s;
}
nav button:hover { background: var(--pink-soft); color: var(--ink); }

.hint {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  font-family: "Silkscreen", monospace; font-size: 12px; color: rgba(42,22,48,0.6);
  pointer-events: none; transition: opacity .6s;
}

.loader {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg1); color: var(--pink-soft);
  font-family: "Silkscreen", monospace; font-size: 14px;
  transition: opacity .8s; z-index: 10;
}
.loader.hidden { opacity: 0; pointer-events: none; }

.panel {
  position: fixed; top: 16px; right: 16px; bottom: 16px;
  width: min(420px, calc(100vw - 32px));
  background: rgba(255, 245, 252, 0.82); backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.7); border-radius: 22px;
  box-shadow: 0 20px 60px rgba(60, 10, 50, 0.25);
  transform: translateX(calc(100% + 40px)); transition: transform .55s cubic-bezier(.2,.8,.2,1);
  overflow-y: auto; z-index: 5;
}
.panel.open { transform: translateX(0); }
.panel-inner { padding: 36px 30px; }
.close {
  position: absolute; top: 14px; right: 16px; width: 34px; height: 34px;
  border-radius: 50%; border: none; background: var(--pink); color: #fff;
  font-size: 20px; cursor: pointer; line-height: 1;
}
.panel .tag {
  font-family: "Silkscreen", monospace; font-size: 11px; color: var(--pink);
  text-transform: lowercase; margin-bottom: 10px;
}
.panel h2 { font-family: "Silkscreen", monospace; font-weight: 400; font-size: 30px; margin-bottom: 14px; }
.panel p { font-size: 15px; line-height: 1.6; color: #4b3550; margin-bottom: 22px; }
.projects { display: grid; gap: 14px; }
.card {
  border-radius: 16px; overflow: hidden; background: #fff;
  border: 1px solid #f0d6ea;
}
.card .thumb {
  aspect-ratio: 16 / 10; background: linear-gradient(135deg, #f8d3ef, #e0368f);
  display: grid; place-items: center; color: #fff;
  font-family: "Silkscreen", monospace; font-size: 12px;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .meta { display: flex; justify-content: space-between; padding: 12px 14px; font-size: 14px; font-weight: 500; }
.card .meta span:last-child { color: #a07a9a; font-weight: 400; }
.tool-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-list button {
  font: 500 13px "Inter", sans-serif; cursor: pointer;
  border: 1px solid #f0c3e4; background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 999px;
}
.tool-list button:hover { background: var(--pink); color: #fff; }
.links { display: flex; flex-direction: column; gap: 10px; }
.links a {
  color: var(--ink); text-decoration: none; font-weight: 500;
  padding: 14px 16px; background: #fff; border-radius: 14px; border: 1px solid #f0d6ea;
  display: flex; justify-content: space-between;
}
.links a:hover { background: var(--pink); color: #fff; }

@media (max-width: 640px) {
  .top { padding: 18px; }
  .brand-name { font-size: 16px; }
  nav button { padding: 6px 10px; font-size: 12px; }
  .panel { top: auto; height: 70vh; transform: translateY(calc(100% + 40px)); }
  .panel.open { transform: translateY(0); }
}

.timeline { display: grid; gap: 12px; }
.entry { background: #fff; border: 1px solid #f0d6ea; border-radius: 16px; padding: 16px 18px; }
.entry-head { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.entry-head span { font-size: 12px; color: #a07a9a; white-space: nowrap; border: 1px solid #f0c3e4; border-radius: 999px; padding: 2px 10px; height: fit-content; }
.entry-place { font-size: 13px; color: var(--pink); margin: 2px 0 8px; }
.entry p { margin: 0; font-size: 14px; }

.switch {
  position: fixed; left: 24px; bottom: 22px; z-index: 4;
  font: 500 12px "Inter", sans-serif; color: var(--ink); text-decoration: none;
  background: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.8);
  padding: 8px 14px; border-radius: 999px; backdrop-filter: blur(8px);
}
.switch:hover { background: var(--pink); color: #fff; }
.sphere-page .hint { color: rgba(255,255,255,0.65); }
.sphere-page .switch { color: #fff; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); }

/* ---------- LED screen UI (sphere page) ---------- */
.screen-ui {
  position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 5;
  opacity: 0; pointer-events: none; transition: opacity .35s;
  border-radius: 10px; overflow: hidden; color: #eef0f6;
  background:
    linear-gradient(rgba(0,0,0,0.55) 1px, transparent 1px) 0 0 / 5px 5px,
    linear-gradient(90deg, rgba(0,0,0,0.55) 1px, transparent 1px) 0 0 / 5px 5px,
    #0b0b0d;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.9);
}
.screen-ui.open { opacity: 1; pointer-events: auto; }
.screen-close {
  position: absolute; top: 12px; right: 14px; z-index: 2; cursor: pointer;
  font: 13px "Silkscreen", monospace; color: #fff; background: none; border: none;
  text-shadow: 0 0 8px rgba(255,255,255,0.7);
}
.screen-close:hover { color: #5b8cff; }
.screen-content { height: 100%; overflow-y: auto; padding: clamp(16px, 3vw, 36px); }
.screen-content::-webkit-scrollbar { width: 6px; }
.screen-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 3px; }
.screen-ui .tag { font: 11px "Silkscreen", monospace; color: #5b8cff; margin-bottom: 8px; text-transform: lowercase; }
.screen-ui h2 {
  font: 400 clamp(22px, 3.4vw, 38px) "Silkscreen", monospace; margin-bottom: 12px; color: #fff;
  text-shadow: 0 0 6px rgba(255,255,255,0.25);
}
.screen-ui p { font-size: 14px; line-height: 1.6; color: #c9ccd8; margin-bottom: 14px; max-width: 60ch; }
.screen-ui .tool-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.screen-ui .tool-list button, .screen-ui .back, .screen-ui .nav button {
  font: 12px "Silkscreen", monospace; cursor: pointer; color: #fff;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 12px; border-radius: 8px;
}
.screen-ui .tool-list button:hover, .screen-ui .back:hover, .screen-ui .nav button:hover:not(:disabled) {
  background: #fff; color: #050506; box-shadow: 0 0 14px rgba(255,255,255,0.6);
}
.screen-ui .nav button:disabled { opacity: 0.3; cursor: default; }
.screen-ui .split { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr; gap: 24px; align-items: start; }
.screen-ui .slide .thumb {
  aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,0.12);
  background: #141416;
  font: 12px "Silkscreen", monospace; color: #fff;
}
.screen-ui .slide .thumb img { width: 100%; height: 100%; object-fit: cover; }
.screen-ui .slide .meta { display: flex; justify-content: space-between; padding: 10px 2px; font: 13px "Silkscreen", monospace; }
.screen-ui .nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.screen-ui .count { font: 12px "Silkscreen", monospace; color: #9aa0b8; }
.screen-ui .timeline { display: grid; gap: 10px; }
.screen-ui .entry { border: 1px solid rgba(255,255,255,0.18); border-radius: 10px; padding: 12px 14px; background: rgba(255,255,255,0.03); }
.screen-ui .entry-head { display: flex; justify-content: space-between; gap: 10px; font: 14px "Silkscreen", monospace; color: #fff; }
.screen-ui .entry-head span { font-size: 11px; color: #9aa0b8; white-space: nowrap; }
.screen-ui .entry-place { font-size: 12px; color: #5b8cff; margin: 4px 0 6px; }
.screen-ui .entry p { margin: 0; font-size: 13px; }
.screen-ui .links { display: grid; gap: 8px; max-width: 420px; }
.screen-ui .links a {
  display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 10px;
  color: #fff; background: rgba(255,255,255,0.04); text-decoration: none; border: 1px solid rgba(255,255,255,0.3); font: 13px "Silkscreen", monospace;
}
.screen-ui .links a:hover { background: #fff; color: #050506; }
@media (max-width: 640px) { .screen-ui .split { grid-template-columns: 1fr; } }

/* phone layout */
@media (max-width: 640px) {
  .top { flex-direction: column; gap: 10px; padding: 16px; }
  .brand-role { font-size: 11px; }
  nav { flex-wrap: wrap; gap: 6px; }
  nav button { padding: 6px 10px; font-size: 11px; }
  .hint { display: none; }
  .switch { left: 50%; transform: translateX(-50%); bottom: 16px; }
  .screen-content { padding: 18px 16px; }
  .screen-ui p { font-size: 13px; }
}

/* About: character on the left (the hat pops out of the green card), text on the right */
.screen-ui .about-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 36px); align-items: center; margin-bottom: 18px; }
.screen-ui .avatar img { display: block; width: 100%; height: auto; }
.screen-ui h2.hello {
  font: 800 clamp(40px, 6vw, 76px)/0.95 "Inter", sans-serif; letter-spacing: -0.04em;
  text-shadow: none; margin-bottom: 16px; color: #fff;
}
.screen-ui h2.hello span { color: #5b8cff; }
.screen-ui .about-text p { font-size: 13.5px; margin-bottom: 10px; }
@media (max-width: 640px) { .screen-ui .about-grid { grid-template-columns: 1fr; } }
.screen-ui .slide .thumb img { cursor: pointer; object-fit: contain; background: #050506; }
.screen-ui .thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.screen-ui .thumbs button { flex: 0 0 auto; width: 56px; height: 40px; padding: 0; border-radius: 6px; overflow: hidden; border: 1px solid rgba(255,255,255,0.15); background: none; cursor: pointer; opacity: 0.55; }
.screen-ui .thumbs button.on, .screen-ui .thumbs button:hover { opacity: 1; border-color: #5b8cff; }
.screen-ui .thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* project images: show the whole picture (square renders too) and keep title + arrows in view */
.screen-ui .slide .thumb { aspect-ratio: auto; height: min(40vh, 380px); }
.screen-ui .slide .thumb img { object-fit: contain; }
/* fix: the picture must fit inside its frame (it was overflowing and getting cut) */
.screen-ui .slide .thumb { display: flex; align-items: center; justify-content: center; }
.screen-ui .slide .thumb img { width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
/* the frame takes the shape of each picture: square renders (Zara, Rabanne…) get a square frame,
   horizontal ones a horizontal frame — no black bands, no cropping */
.screen-ui .slide .thumb { height: auto; width: fit-content; max-width: 100%; margin: 0 auto; background: none; }
.screen-ui .slide .thumb img { width: auto; height: auto; max-width: 100%; max-height: min(36vh, 420px); object-fit: initial; }
/* below the picture: project description on the left, thumbnails + arrows on the right */
.screen-ui .slide-info { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; margin-top: 12px; }
.screen-ui .proj-title { font: 14px "Silkscreen", monospace; color: #fff; margin-bottom: 6px; }
.screen-ui .proj-title span { color: #9aa0b8; font-size: 11px; margin-left: 6px; }
.screen-ui .proj-text p { font-size: 13px; margin: 0; }
.screen-ui .proj-nav { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.screen-ui .proj-nav .thumbs { margin-top: 0; justify-content: flex-end; }
.screen-ui .proj-nav .nav { gap: 14px; }
@media (max-width: 480px) {
  .screen-ui .slide-info { grid-template-columns: 1fr; }
  .screen-ui .proj-nav { align-items: stretch; }
  .screen-ui .proj-nav .nav { justify-content: space-between; }
}
.screen-ui .slide-info { margin: 12px auto 0; max-width: 100%; grid-template-columns: minmax(0, 1fr) auto; }
.screen-ui .proj-nav .thumbs { flex-wrap: wrap; }
.screen-ui .side h2 { overflow-wrap: normal; word-break: normal; hyphens: none; }
.screen-ui .proj-year { font: 12px "Silkscreen", monospace; color: #9aa0b8; margin: -4px 0 12px; }
/* videos in the project viewer behave like the photos */
.screen-ui .slide .thumb video { display: block; width: auto; height: auto; max-width: 100%; max-height: min(36vh, 420px); background: #000; }
.screen-ui .thumbs button { position: relative; }
.screen-ui .thumbs video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.screen-ui .thumbs button.vid::after {
  content: "▶"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 12px; color: #fff; text-shadow: 0 0 4px #000;
}
.screen-ui .proj-nav .nav { flex-wrap: nowrap; white-space: nowrap; }

/* ---------- spec sheets beside the sphere (desktop) ---------- */
.spec {
  position: fixed; top: 50%; transform: translateY(-62%); width: min(19vw, 280px);
  color: #fff; pointer-events: none; z-index: 2; transition: opacity 0.4s ease;
}
.spec-left { left: 46px; }
.spec-right { right: 46px; }
.spec-title {
  font: 400 clamp(22px, 2.2vw, 32px) "Silkscreen", monospace; letter-spacing: 0.02em;
  padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,0.55);
}
.spec-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 12px 0 14px; border-bottom: 1px solid rgba(255,255,255,0.22);
}
.spec-label { font: 500 10px "Inter", sans-serif; letter-spacing: 0.24em; text-transform: uppercase; opacity: 0.6; white-space: nowrap; }
.spec-value { font: 500 15px/1.45 "Inter", sans-serif; text-align: right; }
.spec-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px;
  background: #c6ff3d; box-shadow: 0 0 8px #c6ff3d; vertical-align: 1px; animation: spec-blink 2.4s infinite;
}
@keyframes spec-blink { 50% { opacity: 0.35; } }
body:has(#panel[aria-hidden="false"]) .spec { opacity: 0; }
@media (max-width: 1100px) { .spec { display: none; } }
.spec-sub { margin-top: 34px; font-size: clamp(16px, 1.5vw, 22px); }
.spec-right { transform: translateY(-50%); }
/* the instructions now live in the side sheet; between phone and desktop they sit under the header */
@media (min-width: 1101px) { .sphere-page .hint { display: none; } }
@media (max-width: 1100px) { .sphere-page .hint { left: auto; right: 24px; bottom: 24px; transform: none; max-width: 150px; text-align: right; line-height: 1.7; font-size: 10px; } }
/* phone: the screen now touches the bottom, so the keyboard link moves up beside the nav */
@media (max-width: 640px) { .sphere-page .switch { top: 118px; bottom: auto; left: auto; right: 16px; transform: none; padding: 5px 10px; font-size: 11px; } }

/* ---------- loading screen: the name, a blinking cursor and a thin bar ---------- */
.sphere-page .loader { background: #02031a; color: #fff; }
.loader-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.loader-name { font: 400 clamp(22px, 4vw, 44px) "Silkscreen", monospace; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.loader-name i { font-style: normal; animation: loader-blink 0.9s steps(1) infinite; }
.loader-bar { position: relative; width: min(240px, 60vw); height: 2px; background: rgba(255,255,255,0.15); overflow: hidden; }
.loader-bar::after { content: ""; position: absolute; inset: 0; width: 35%; background: currentColor; animation: loader-run 1.2s ease-in-out infinite; }
@keyframes loader-blink { 50% { opacity: 0; } }
@keyframes loader-run { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* ---------- contact: links left, QR right ---------- */
.screen-ui .contact-grid { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.screen-ui .qr { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: #9aa0b8; font: 11px "Silkscreen", monospace; text-transform: lowercase; }
.screen-ui .qr-code { width: clamp(130px, 14vw, 200px); aspect-ratio: 1; padding: 10px; border: 1px solid rgba(255,255,255,0.3); border-radius: 12px; }
.screen-ui .qr-code svg, .screen-ui .qr-code img { display: block; width: 100%; height: 100%; object-fit: contain; }
.screen-ui .qr:hover .qr-code { border-color: #fff; }
@media (max-width: 640px) { .screen-ui .contact-grid { grid-template-columns: 1fr; gap: 20px; } .screen-ui .qr-code { width: 140px; } }

/* ---------- empty tool: moving "coming soon" band ---------- */
.screen-ui .soon {
  margin: 18px -40px 22px; padding: 14px 0; overflow: hidden;
  transform: rotate(-3deg); display: flex; flex-direction: column; gap: 6px;
}
.screen-ui .soon-row { display: flex; width: max-content; }
.screen-ui .soon-track { display: flex; flex-shrink: 0; animation: soon-run 26s linear infinite; }
.screen-ui .soon-rev .soon-track { animation-direction: reverse; opacity: 0.35; }
.screen-ui .soon span {
  font: 500 clamp(30px, 4.4vw, 60px)/1.1 "Inter", sans-serif; letter-spacing: -0.03em;
  text-transform: uppercase; color: #e9e9ee; white-space: nowrap; padding-right: 0.7em;
}
@keyframes soon-run { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .screen-ui .soon-track { animation: none; } }
.screen-ui .screen-content:has(.soon) { overflow-x: hidden; }
@media (max-width: 640px) {
  .screen-ui .screen-content:has(.soon) { display: flex; flex-direction: column; }
  .screen-ui .screen-content:has(.soon) .soon { margin-top: auto; margin-bottom: 28px; }
  .screen-ui .screen-content:has(.soon) .back { margin: 0 auto auto; }
}
body:has(#panel[aria-hidden="false"]) .switch { opacity: 0; pointer-events: none; }
body:has(#panel[aria-hidden="false"]) .hint { opacity: 0; }
/* coming soon: band centred in the screen at every size */
.screen-ui .screen-content:has(.soon) { display: flex; flex-direction: column; }
.screen-ui .screen-content:has(.soon) .soon { margin-top: auto; margin-bottom: 24px; }
.screen-ui .screen-content:has(.soon) .back { margin: 0 auto auto; }
