/* ==========================================================================
   Roger Arola - portfolio
   Palette: off-white + off-black only. No accent colour.
   Shape rule: every interactive element is a full pill.
   Z scale: bar/foot 20, intro 40, dialog = top layer.
   ========================================================================== */

/* Alte Haas Grotesk (Yann Le Coroller). Only two weights exist: 400 and 700. */
@font-face {
  font-family: "Alte Haas Grotesk";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/AlteHaasGrotesk-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Alte Haas Grotesk";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("assets/fonts/AlteHaasGrotesk-Bold.woff2") format("woff2");
}

:root {
  --bg: #fbfbfa;
  --ink: #0b0b0d;
  --muted: #5d5d66;
  --line: rgba(11, 11, 13, 0.14);
  --pad: clamp(20px, 3.4vw, 56px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fs: 8vw;                      /* wheel type size, refined by JS so the longest name fits */
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Alte Haas Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;               /* single screen: the wheel takes the scroll */
  overscroll-behavior: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100dvh;
}

::selection { background: var(--ink); color: var(--bg); }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: var(--pad); top: -80px; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px;
  text-decoration: none; transition: top 0.2s var(--ease);
}
.skip:focus { top: 12px; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 0.55em;
  height: 40px; padding: 0 18px;
  border-radius: 999px; border: 1.5px solid var(--ink);
  font-weight: 700; font-size: 14px; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), transform 0.2s var(--ease);
}
.pill:active { transform: scale(0.97); }
.pill-solid { background: var(--ink); color: var(--bg); }
.pill-line  { background: transparent; color: var(--ink); }
@media (hover: hover) {
  .pill-solid:hover { background: transparent; color: var(--ink); }
  .pill-line:hover  { background: var(--ink); color: var(--bg); }
  .pill:hover .arrow { transform: translate(2px, -2px); }
}
.arrow { width: 1em; height: 1em; flex: none; transition: transform 0.35s var(--ease); }

/* ---------- Top bar ---------- */
.bar {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 72px; padding: 0 var(--pad);
}
.brand {
  margin: 0;
  font-size: 17px; font-weight: 700;
  letter-spacing: -0.01em; text-transform: uppercase; white-space: nowrap;
}
.bar-nav { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }

/* ---------- Stage ---------- */
.stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 23rem);
  align-items: center;
  column-gap: clamp(32px, 5vw, 96px);
  padding: 0 var(--pad);
  min-height: 0;
}

/* Left: the type wheel */
.wheel {
  position: relative;
  height: 100%;
  min-height: 0; min-width: 0;
  overflow: hidden;
  touch-action: none;             /* vertical drag is handled in JS */
  outline: none;
  cursor: grab;
  font-size: var(--fs);
  /* names dissolve into the page at the top and bottom */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24%, #000 76%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 24%, #000 76%, transparent 100%);
}
.wheel.dragging { cursor: grabbing; }
.wheel:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 12px; }

.item {
  position: absolute; left: 0; top: 50%;
  margin-top: -0.5em;
  display: inline-block;
  font-weight: 700; line-height: 1; letter-spacing: -0.035em; text-transform: uppercase;
  white-space: nowrap; text-decoration: none; color: var(--ink);
  transform-origin: left center;
  will-change: transform, opacity;
  user-select: none; -webkit-user-drag: none;
  padding: 0.04em 0.06em 0.04em 0;
}
/* outlined copy: what the resting names look like */
.item-stroke {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(11, 11, 13, 0.34);
}
/* solid copy on top: only the active name is filled */
.item-fill {
  position: absolute; left: 0; top: 0.04em;
  display: flex; align-items: center; gap: 0.12em;
  opacity: 0;
  will-change: opacity;
}
.item-arrow {
  width: 0.62em; height: 0.62em; flex: none;
  opacity: 0; transform: translate(-0.18em, 0.18em);
  transition: opacity 0.4s var(--ease), transform 0.6s var(--ease);
}
.item-arrow path { stroke: currentColor; stroke-width: 10; stroke-linejoin: round; }
.item.is-active .item-arrow { opacity: 0.18; transform: none; }
@media (hover: hover) {
  .item.is-active:hover .item-arrow { opacity: 1; transform: translate(0.06em, -0.06em); }
}
@media (hover: none) { .item.is-active .item-arrow { opacity: 1; } }

/* Right: description */
.info { max-width: 23rem; }
.info-desc {
  margin: 0 0 20px;
  font-size: clamp(18px, 1.5vw, 23px); line-height: 1.28; font-weight: 400;
  letter-spacing: -0.01em;
}
.tags { list-style: none; margin: 0 0 30px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  height: 30px; padding: 0 12px; display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; color: var(--muted);
}
.visit { height: 48px; padding: 0 24px; font-size: 15px; }

/* ---------- Footer ---------- */
.foot {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: 68px; padding: 0 var(--pad);
}
.lang { display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 700; color: var(--muted); margin-left: -8px; }
.lang button {
  height: 40px; padding: 0 8px;
  color: var(--muted); text-decoration: none;
  transition: color 0.3s var(--ease);
}
.lang button[aria-pressed="true"] { color: var(--ink); }
@media (hover: hover) { .lang button:hover { color: var(--ink); } }

.index { display: flex; gap: 6px; margin-right: -12px; }
.index button {
  position: relative; height: 40px; padding: 0 12px;
  font-size: 14px; font-weight: 700; color: var(--muted);
  transition: color 0.3s var(--ease);
}
.index button::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 7px; height: 2px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.index button[aria-current="true"] { color: var(--ink); }
.index button[aria-current="true"]::after { transform: scaleX(1); }
@media (hover: hover) { .index button:hover { color: var(--ink); } }

/* ---------- Intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  display: grid; place-items: center;
  font-weight: 700; font-size: 11.5vw; letter-spacing: -0.05em; line-height: 1;
  text-transform: uppercase; white-space: nowrap;
}
.intro-mask { display: inline-block; overflow: hidden; padding: 0.05em 0.04em; }
.intro-mask > span { display: inline-block; transform: translateY(110%); }
.intro.is-done { display: none; }

/* UI chrome enters after the intro */
.js .bar, .js .foot, .js .side-info { opacity: 0; }
.js.is-ready .bar, .js.is-ready .foot, .js.is-ready .side-info {
  opacity: 1; transition: opacity 0.9s var(--ease) 0.15s;
}

/* ---------- About dialog ---------- */
.about {
  width: 100vw; max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--bg); color: var(--ink);
  overflow-y: auto;
}
.about::backdrop { background: var(--bg); }
.about[open] { animation: aboutIn 0.7s var(--ease); }
.about.is-closing { animation: aboutOut 0.35s ease-in forwards; }
@keyframes aboutIn  { from { transform: translateY(6%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes aboutOut { to { transform: translateY(4%); opacity: 0; } }

.about-inner {
  min-height: 100%;
  display: flex; flex-direction: column;
  padding: 0 var(--pad) var(--pad);
}
.about-top { display: flex; align-items: center; justify-content: space-between; height: 72px; flex: none; }
.about-lead {
  margin: clamp(24px, 6vh, 72px) 0 clamp(28px, 5vh, 56px);
  max-width: 22em;
  font-size: clamp(26px, 3.6vw, 56px); line-height: 1.04; font-weight: 700; letter-spacing: -0.035em;
}
.about-list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.about-list li {
  display: grid; grid-template-columns: 32% minmax(0, 1fr) auto; gap: 8px 24px; align-items: baseline;
  padding: 18px 0;
}
.about-list li + li { border-top: 1px solid var(--line); }
.about-list strong { font-size: clamp(18px, 1.7vw, 24px); font-weight: 700; letter-spacing: -0.02em; text-transform: uppercase; }
.about-list span { color: var(--muted); font-size: 16px; }
.about-list a { font-weight: 700; font-size: 14px; text-underline-offset: 4px; white-space: nowrap; }
.about-contact {
  margin-top: auto; padding-top: clamp(32px, 6vh, 72px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px;
}
.about-mail {
  font-size: clamp(24px, 5.2vw, 84px); font-weight: 700; letter-spacing: -0.045em; line-height: 1;
  text-decoration: none; color: var(--ink);
  background: linear-gradient(var(--ink), var(--ink)) left bottom / 0 0.07em no-repeat;
  transition: background-size 0.6s var(--ease);
  padding-bottom: 0.09em;
}
@media (hover: hover) { .about-mail:hover { background-size: 100% 0.07em; } }

.noscript { padding: var(--pad); }

/* ---------- Tablet / mobile: single column ---------- */
@media (max-width: 820px) {
  .bar { height: 60px; }
  .brand { font-size: 15px; }
  .pill { height: 38px; padding: 0 15px; font-size: 13px; }

  .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    row-gap: 8px;
  }
  .info { max-width: 34rem; padding-bottom: 8px; }
  .info-desc { font-size: 17px; margin-bottom: 14px; min-height: 3.9em; }
  .tags { margin-bottom: 20px; }
  .visit { height: 46px; }

  .item-arrow { display: none; }
  .item-stroke { -webkit-text-stroke-width: 1px; }

  .foot { height: 56px; }
  .index { display: none; }       /* the wheel itself lists every project on small screens */

  .about-top { height: 60px; }
  .about-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .about-list span { grid-column: 1 / -1; grid-row: 2; font-size: 15px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .intro { display: none; }
}
