/* ==========================================================================
   Piso9 Studio — main stylesheet
   Palette and type roles are documented in CLAUDE.md.
   ========================================================================== */

/* --- Fonts (self-hosted, woff2 only) ------------------------------------- */

/* Orbitron — wordmark & headings. Only 700 is used. (OFL, via Google Fonts) */
@font-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/orbitron-700.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* VT323 — terminal/OSD accents (hero CTA, embed button). (OFL) */
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/vt323-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Satoshi — UI & body. (Fontshare ITF FFL) */
@font-face {
  font-family: 'Satoshi';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/satoshi-400.woff2") format('woff2');
}
@font-face {
  font-family: 'Satoshi';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/satoshi-500.woff2") format('woff2');
}
@font-face {
  font-family: 'Satoshi';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/satoshi-700.woff2") format('woff2');
}

/* --- Base ----------------------------------------------------------------- */

:root {
  --bg: #0a0a0a;
  --fg: #fafafa;
  --accent: #ff8c00;
  --muted: #a3a3a3;
  --dim: #808080; /* AA 4.5:1 sobre --bg y --card; el diseño original usaba #737373 */
  --line: #262626;
  --card: #141414;
  --font-sans: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Orbitron", "Satoshi", sans-serif;
  --font-mono: "VT323", ui-monospace, Menlo, Consolas, monospace;
}

html {
  scroll-behavior: smooth;
}

/* --- TV-only mode ----------------------------------------------------------
   Set on <html> by an inline script before first paint; removed by hero.js
   when WebGL is unavailable. The page becomes just the TV (100vh, no scroll);
   the sections below stay in the DOM as sr-only fallback (screen readers and
   crawlers keep them — display:none would drop them from the a11y tree). */
.p9-tv,
.p9-tv body {
  height: 100%;
  overflow: hidden;
}

.p9-tv main,
.p9-tv .site-footer {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

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

a {
  color: var(--fg);
  text-decoration: none;
  transition: color 120ms linear;
}

a:hover {
  color: var(--accent);
}

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

/* --- Hero ------------------------------------------------------------------ */

.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  background: var(--bg);
}

piso9-hero {
  position: absolute;
  inset: 0;
}

/* Static wordmark shown only when JS is disabled (inside <noscript>). */
.hero-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 14vw var(--font-display);
  letter-spacing: 0;
  color: var(--fg);
}

.hero-fallback .accent {
  color: var(--accent);
}

/* --- Sections ---------------------------------------------------------------- */

.section {
  max-width: 960px;
  margin: 0 auto;
  padding: 128px 32px 0;
}

.section-work,
.section-contact {
  scroll-margin-top: 48px;
}

.section-contact {
  padding: 176px 32px 128px;
}

.intro-copy {
  margin: 0;
  font-size: 24px;
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.01em;
  max-width: 720px;
  color: var(--fg);
}

.eyebrow {
  margin: 0 0 56px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.section-contact .eyebrow {
  margin-bottom: 24px;
}

/* --- Work / project cards ------------------------------------------------------ */

.project {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.project + .project {
  padding-top: 96px;
}

.project:not(:last-child) {
  padding-bottom: 96px;
  border-bottom: 1px solid var(--line);
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.project-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.project-year {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.project-desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 640px;
}

.project-meta {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--dim);
}

/* Browser-chrome card around embeds/screenshots */
.browser-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.browser-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--accent);
  display: block;
}

.browser-url {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.browser-card img,
.browser-card iframe {
  display: block;
  width: 100%;
  background: var(--bg);
}

.browser-card img {
  height: auto;
}

.browser-card iframe {
  height: 560px;
  border: 0;
}

/* Click-to-load facade for live embeds (js/main.js swaps in the iframe) */
.embed {
  position: relative;
  height: 560px;
  background: var(--bg);
}

.embed-poster {
  position: absolute;
  inset: 0;
  display: block;
}

.embed-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.embed-load {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 20px;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: rgba(10, 10, 10, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  transition: border-color 120ms linear;
}

.embed-load:hover,
.embed-load:focus-visible {
  border-color: var(--accent);
}

/* --- Contact ------------------------------------------------------------------- */

.contact-title {
  margin: 0 0 32px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.contact-title .accent {
  color: var(--accent);
}

.contact-copy {
  margin: 0 0 40px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 480px;
}

.contact-cta {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(18px, 2.5vw, 26px);
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

/* --- Footer ---------------------------------------------------------------------- */

.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.site-footer a {
  color: var(--dim);
}

.site-footer a:hover {
  color: var(--accent);
}
