/*
 * Steel prototype styles.
 * --u is one design px of the 1440 x 900 Pencil frame, so desktop positions
 * below are the frame values multiplied by --u.
 */
:root {
  --ink: #E8ECEE;
  --ink-2: #BCC3C8;
  --bg: #0A0C0E;
  --ember: #FF5A1F;
  --u: clamp(0.6px, min(100vw / 1440, 100vh / 900), 1.6px);
  --small: max(13px, calc(15 * var(--u)));
  --body: max(14px, calc(19 * var(--u)));
}

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
html.dialog-open { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  /* static stand-in for the steel when WebGL is not available */
  background:
    radial-gradient(circle calc(1450 * var(--u)) at calc(100% + 610 * var(--u)) calc(1450 * var(--u)),
      #7b8286 0%, #a3aaae 52%, #6d7377 93%, #2a2e31 97.5%, #16191c 100%) fixed,
    #16191c;
}
.gl-on body { background: var(--bg); }

p, h1, h2, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }

.vh {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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

#steel {
  position: fixed; left: 0; top: 0; width: 100vw; height: 100vh;
  z-index: 0; display: none; pointer-events: none;
}
.gl-on #steel { display: block; }

/* ---------- stage ---------- */

.stage {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  max-width: calc(1760 * var(--u));
  min-height: max(100vh, calc(900 * var(--u)));
}
.stage--work { min-height: max(100vh, calc(1300 * var(--u))); }
/* the page text steps back while the lens expands into the overlay */
.stage { transition: opacity .3s ease; }
.dialog-open .stage { opacity: 0; }

.top { position: absolute; left: 0; right: 0; top: 0; }
.loc {
  position: absolute; left: calc(64 * var(--u)); top: calc(43 * var(--u));
  font-size: var(--small); font-weight: 500; line-height: 1.4; color: var(--ink-2);
}
.nav { position: absolute; right: calc(64 * var(--u)); top: calc(40 * var(--u)); }
.nav ul { display: flex; gap: calc(34 * var(--u)); }
.nav a {
  display: inline-flex; align-items: center; gap: 4px;
  padding-bottom: 7px; border-bottom: 3px solid transparent;
  font-size: var(--small); font-weight: 500; line-height: 1.4;
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
  transition: color .2s ease;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ember); }
.nav .ico { width: max(11px, calc(13 * var(--u))); height: max(11px, calc(13 * var(--u))); }

.display {
  position: absolute; left: calc(47 * var(--u)); top: calc(104 * var(--u));
  font-size: calc(132 * var(--u)); font-weight: 400; line-height: 0.92;
  letter-spacing: calc(-3.5 * var(--u)); color: var(--ink);
}

.foot {
  position: absolute; left: calc(64 * var(--u)); bottom: calc(43 * var(--u));
  font-size: var(--small); font-weight: 500; line-height: 1.4; color: var(--ink-2);
}
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

.status {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--small); font-weight: 500; line-height: 1.4; color: var(--ink-2);
}
.status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none;
}
.status--live::before { background: var(--ember); }

/* hover cue: appears when the project is in focus (row, caption or lens) */
.open-cue {
  font-size: var(--small); font-weight: 500; line-height: 1.4; color: var(--ink);
  opacity: 0; transform: translateX(-4px);
  transition: opacity .25s ease, transform .25s ease;
}
.is-active .open-cue, .open-cue:focus-visible { opacity: 1; transform: none; }
.caption .open-cue { margin-top: 4px; }

/* ---------- lenses ---------- */

.lens {
  position: absolute; display: block; padding: 0; margin: 0; border: 0;
  border-radius: 50%; background: none; color: inherit; font: inherit;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  aspect-ratio: 1 / 1;
}
.lens:focus-visible { outline-offset: 8px; border-radius: 50%; }
.lens img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  border-radius: 50%; filter: brightness(0.8);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 14px 18px 40px rgba(0, 0, 0, 0.45);
  transition: transform .3s ease, filter .3s ease;
}
.lens.is-active img { transform: scale(1.04); filter: none; }
.gl-on .lens img { opacity: 0; transition: none; }

.lens--ph {
  cursor: default; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(10, 12, 14, 0.35);
}
.ph-label { font-size: max(12px, calc(13 * var(--u))); font-weight: 500; color: var(--ink); }
.gl-on .lens--ph { border-color: transparent; background: none; }
.gl-on .ph-label { opacity: 0; }

/* ---------- home ---------- */

.role {
  position: absolute; left: calc(64 * var(--u)); top: calc(392 * var(--u));
  font-size: max(18px, calc(30 * var(--u))); line-height: 1.4; color: var(--ink);
}
.tagline {
  position: absolute; left: calc(64 * var(--u)); top: calc(439 * var(--u));
  font-size: var(--body); font-weight: 500; line-height: 1.4; color: var(--ink-2);
}
.lens--home-piggy {
  left: calc(100% - 555 * var(--u)); top: calc(235 * var(--u)); width: calc(470 * var(--u));
}
.caption {
  position: absolute; left: calc(64 * var(--u)); top: calc(712 * var(--u));
  display: flex; flex-direction: column; gap: 5px;
}
.cap-title { font-size: max(14px, calc(17 * var(--u))); font-weight: 500; line-height: 1.4; color: var(--ink); }
.caption .status { font-size: max(12px, calc(14 * var(--u))); gap: 7px; }

/* ---------- work ---------- */

.stage--work main { padding-top: calc(104 * var(--u)); padding-bottom: calc(120 * var(--u)); }
.stage--work .display { position: static; margin-left: calc(47 * var(--u)); font-size: calc(76 * var(--u)); letter-spacing: calc(-2 * var(--u)); }
.subline {
  margin: calc(20 * var(--u)) 0 0 calc(64 * var(--u));
  font-size: max(16px, calc(24 * var(--u))); line-height: 1.375; color: var(--ink);
}
.projects--work { margin: calc(44 * var(--u)) 0 0 calc(64 * var(--u)); width: calc(500 * var(--u)); }
.row { border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: calc(30 * var(--u)); min-height: calc(300 * var(--u)); }
.row--piggy { min-height: calc(399 * var(--u)); }
.row--placeholder { min-height: 0; }
.row-text { position: relative; display: flex; flex-direction: column; gap: calc(12 * var(--u)); }
.idx { font-size: var(--small); font-weight: 500; line-height: 1.4; color: var(--ink); }
.row-title {
  font-size: calc(40 * var(--u)); font-weight: 400; line-height: 1.1; letter-spacing: calc(-1 * var(--u)); color: var(--ink);
}
.row-title--lg { font-size: calc(56 * var(--u)); }
.row-link {
  padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit;
  letter-spacing: inherit; text-align: left; cursor: pointer;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0 1px;
  transition: background-size .35s ease;
}
.row-link::after { content: ""; position: absolute; inset: calc(-12 * var(--u)) 0; }
.row-text.is-active .row-link { background-size: 100% 1px; }
.row-line { font-size: var(--body); font-weight: 500; line-height: 1.5; color: var(--ink-2); }
.row .status { padding-top: 6px; }

.lens--work-piggy { left: calc(100% - 610 * var(--u)); top: calc(133 * var(--u)); width: calc(460 * var(--u)); }
.lens--work-tracker { left: calc(100% - 500 * var(--u)); top: calc(633 * var(--u)); width: calc(240 * var(--u)); }
.lens--work-placeholder { left: calc(100% - 500 * var(--u)); top: calc(933 * var(--u)); width: calc(240 * var(--u)); }

/* ---------- overlay ---------- */

.pd {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0B0D0F; color: var(--ink); overflow: auto;
  opacity: 0; transition: opacity .26s ease;
}
.pd::backdrop { background: transparent; }
.pd.is-in { opacity: 1; }
.pd-inner {
  min-height: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: clamp(24px, 4vw, 64px); align-items: center;
  padding: 84px clamp(20px, 4.5vw, 64px) 48px;
}
.pd-shot { display: flex; justify-content: center; }
.pd-shot img {
  display: block; height: auto; border-radius: 4px;
  width: min(100%, calc(100vh - 150px));
  aspect-ratio: 1 / 1;
}
.pd-info { display: flex; flex-direction: column; gap: 14px; }
.pd-info h2 { font-size: clamp(30px, 3.4vw, 52px); font-weight: 400; line-height: 1.1; letter-spacing: -0.02em; }
.pd-line { font-size: clamp(16px, 1.4vw, 20px); font-weight: 500; line-height: 1.5; color: var(--ink-2); }
.pd-info .status { font-size: 15px; }
.pd-close {
  position: fixed; top: 26px; right: clamp(20px, 4.5vw, 64px); z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px;
  background: rgba(11, 13, 15, 0.6); color: var(--ink); font: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer; transition: border-color .2s ease, background-color .2s ease;
}
.pd-close span { font-size: 20px; line-height: 0.8; }
.pd-close:hover { border-color: var(--ink); background: rgba(232, 236, 238, 0.08); }

/* ---------- stacked layout: narrow or portrait viewports ---------- */

@media (max-width: 820px), (max-aspect-ratio: 1/1) and (max-width: 1100px) {
  html:not(.fx) { --u: 1px; --small: 14px; --body: 16px; }

  html:not(.fx) .stage,
  html:not(.fx) .stage--work {
    max-width: none; min-height: 100vh; padding: 20px 20px 24px;
    display: flex; flex-direction: column;
  }
  html:not(.fx) .top { position: static; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  html:not(.fx) .loc,
  html:not(.fx) .nav { position: static; }
  html:not(.fx) .nav ul { gap: 18px; }

  html:not(.fx) .display,
  html:not(.fx) .stage--work .display {
    position: static; margin: 30px 0 0 -0.05em;
    font-size: min(25vw, 200px); letter-spacing: -0.03em;
  }
  html:not(.fx) .role { position: static; margin-top: 22px; font-size: 22px; }
  html:not(.fx) .tagline { position: static; margin-top: 4px; }

  html:not(.fx) .proj { display: flex; flex-direction: column; align-items: center; }
  html:not(.fx) .lens,
  html:not(.fx) .lens--home-piggy,
  html:not(.fx) .lens--work-piggy {
    position: static; width: min(84vw, 60vh, 560px); margin: 40px auto 0;
  }
  html:not(.fx) .caption,
  html:not(.fx) .row-text,
  html:not(.fx) .foot {
    background: rgba(10, 12, 14, 0.72);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-radius: 14px;
  }
  html:not(.fx) .caption { position: static; margin-top: 26px; padding: 12px 18px; align-self: flex-start; }
  html:not(.fx) .foot { position: static; margin-top: 36px; padding: 10px 14px; align-self: flex-start; }
  html:not(.fx) main { flex: 1 0 auto; }

  html:not(.fx) .stage--work main { padding: 0; }
  html:not(.fx) .subline { margin: 14px 0 0; font-size: 18px; }
  html:not(.fx) .projects--work { margin: 12px 0 0; width: auto; }
  html:not(.fx) .row,
  html:not(.fx) .row--piggy,
  html:not(.fx) .row--placeholder {
    min-height: 0; border-top: 0; padding: 0 0 12px;
    display: flex; flex-direction: column;
  }
  html:not(.fx) .row .lens { order: -1; }
  html:not(.fx) .lens--work-tracker,
  html:not(.fx) .lens--work-placeholder { width: min(56vw, 300px); margin-top: 36px; }
  html:not(.fx) .row-text { margin-top: 22px; padding: 16px 18px; gap: 8px; }
  html:not(.fx) .row-title { font-size: 30px; letter-spacing: -0.5px; }
  html:not(.fx) .row-title--lg { font-size: 38px; }
  html:not(.fx) .row-link::after { inset: 0; }

  html:not(.fx) .pd-inner { grid-template-columns: 1fr; align-items: start; align-content: start; padding: 84px 20px 32px; }
  html:not(.fx) .pd-shot img { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
html.force-reduced *, html.force-reduced *::before, html.force-reduced *::after {
  transition: none !important; animation: none !important;
}
