/* ============================================================
   portal.css — JN STUDIO front door.
   Sober, hard-edged, borderless. Flat panels separated by tone,
   hairline dividers only. Steel-cyan accent on near-black.
   ============================================================ */

:root {
  --bg:        #0a0b0e;
  --bg-2:      #101218;
  --bg-3:      #161922;
  --panel:     #12141b;
  --ink:       #e7ebf2;
  --ink-dim:   #9aa3b2;
  --ink-faint: #5c6678;
  --line:      rgba(255, 255, 255, 0.06);
  --line-2:    rgba(255, 255, 255, 0.12);
  --accent:    #5ad1e6;   /* steel cyan */
  --accent-2:  #e6a15a;   /* warm signal */
  --new:       #6fe39b;
  --sans: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* class display: rules must not override the hidden attr */

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Faint engineering grid behind everything */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--bg-2) 0%, var(--bg) 55%),
    repeating-linear-gradient(0deg, transparent 0 39px, var(--line) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, var(--line) 39px 40px);
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 95%);
}

/* ─────────────── header ─────────────── */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(16px, 4vw, 48px) 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  letter-spacing: 0.18em;
}
.brand-mark {
  font-weight: 700;
  font-size: clamp(22px, 3.4vw, 34px);
  color: var(--bg);
  background: var(--accent);
  padding: 2px 9px;
  line-height: 1;
}
.brand-word {
  font-weight: 600;
  font-size: clamp(18px, 2.8vw, 28px);
  letter-spacing: 0.34em;
}
.brand:hover .brand-mark { background: #7fe0f0; }

.other-work { display: flex; gap: 10px; }
.ow-link {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-decoration: none;
  color: var(--ink-dim);
  padding: 4px 10px;
  background: var(--bg-2);
  transition: background 0.15s, color 0.15s;
}
.ow-link:hover { background: var(--bg-3); color: var(--ink); }
.ow-name { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; }
.ow-note {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-2);
}
/* live-detect states (set by portal.js probeLive) */
.ow-note.live, .sp-note.live { color: var(--new); }
.ow-note.off,  .sp-note.off  { color: var(--ink-faint); }

/* ─────────────── main nav ─────────────── */
.main-nav {
  display: flex;
  gap: 2px;
  padding: 0 clamp(16px, 4vw, 48px);
  margin-top: 18px;
}
.nav-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-dim);
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(15px, 1.8vw, 18px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 12px 22px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}
.nav-tab::after {
  content: "";
  position: absolute;
  left: 22px; right: 22px; bottom: 6px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-tab:hover { color: var(--ink); }
.nav-tab.active { color: var(--ink); }
.nav-tab.active::after { transform: scaleX(1); }

/* ─────────────── sub-nav rails ─────────────── */
.subnav {
  display: flex;
  gap: 8px;
  padding: 10px clamp(16px, 4vw, 48px) 0;
  animation: drop 0.22s ease both;
}
@keyframes drop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sub-chip {
  border: 0;
  background: var(--bg-2);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sub-chip em { color: var(--accent); font-style: normal; }
.sub-chip:hover { background: var(--bg-3); color: var(--ink); }
.sub-chip.active { background: var(--accent); color: var(--bg); }
.sub-chip.active em { color: var(--bg); }

/* ─────────────── content ─────────────── */
.content {
  flex: 1;
  padding: 26px clamp(16px, 4vw, 48px) 60px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}
.panel { animation: fade 0.25s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.panel-title {
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.cat-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 10px;
  background: var(--bg-2);
}
.lede {
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.6;
  max-width: 62ch;
  margin: 0 0 22px;
}
.lede strong { color: var(--ink); font-weight: 600; }

/* ── home ── */
.home-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
}
.news { list-style: none; margin: 0; padding: 0; }
.news li {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: start;
}
.news li:first-child { border-top: 0; }
.news-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  padding-top: 3px;
}
.news-body h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}
.news-body h3 .tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--new);
  border: 1px solid var(--new);
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: middle;
}
.news-body p { margin: 0; color: var(--ink-dim); font-size: 14px; line-height: 1.55; }

.home-side .lede { margin-bottom: 18px; }
.side-projects { display: flex; flex-direction: column; gap: 8px; }
.side-proj {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  background: var(--bg-2);
  padding: 12px 14px;
  transition: background 0.15s;
}
.side-proj:hover { background: var(--bg-3); }
.side-proj .sp-name { font-weight: 600; font-size: 14px; }
.side-proj .sp-note { font-family: var(--mono); font-size: 10px; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.1em; }

/* ── tiles (interactive / games) ── */
.tiles, .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s;
  border: 0;
  text-align: left;
  padding: 0;
  font-family: inherit;
}
.tile:hover { transform: translateY(-3px); background: var(--bg-3); }
.tile.locked { cursor: default; opacity: 0.62; }
.tile.locked:hover { transform: none; background: var(--panel); }

.tile-art {
  aspect-ratio: 16 / 10;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-art .motif { width: 64%; height: 64%; opacity: 0.9; }
.tile-badge {
  position: absolute;
  top: 10px; left: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  background: var(--new);
  color: var(--bg);
  font-weight: 700;
}
.tile-badge.soon { background: var(--ink-faint); color: var(--ink); }
.tile-badge.live { background: var(--accent); color: var(--bg); }
.tile-badge.off  { background: var(--ink-faint); color: var(--ink); }
.tile-ext {
  position: absolute;
  top: 10px; right: 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  opacity: 0.7;
}
.tile-body { padding: 14px 16px 16px; }
.tile-name { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.tile-desc { font-size: 13px; color: var(--ink-dim); line-height: 1.5; margin: 0; }

/* ── extra ── */
.extra-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: start;
}
.extra-about h3 { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.extra-links { display: flex; flex-direction: column; gap: 8px; }
.extra-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  background: var(--bg-2);
  padding: 14px 16px;
  transition: background 0.15s;
}
.extra-link:hover { background: var(--bg-3); }
.xl-name { font-weight: 600; font-size: 15px; }
.xl-note {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

/* gallery placeholder cells */
.clip-empty {
  aspect-ratio: 16 / 10;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ─────────────── footer ─────────────── */
.site-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 20px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.foot-dot { opacity: 0.5; }

/* ─────────────── responsive ─────────────── */
@media (max-width: 720px) {
  .home-grid, .extra-grid { grid-template-columns: 1fr; gap: 28px; }
  .other-work { display: none; }
  .main-nav { overflow-x: auto; }
  .news li { grid-template-columns: 74px 1fr; gap: 12px; }
}
