/* ==========================================================================
   hectormurlopez.com — shared stylesheet (index.html + 404.html)
   Palette: Miró-inspired editorial
   ========================================================================== */

/* Familjen Grotesk (SIL OFL, see /fonts/LICENSE) — warm rounded grotesque
   in the spirit of the original Coolvetica branding. The previously
   committed coolvetica.woff/.woff2 were corrupt (HTML pages, never loaded). */
@font-face {
  font-family: 'Familjen Grotesk';
  src: url('/fonts/familjen-grotesk-latin-400-normal.woff2') format('woff2'),
       url('/fonts/familjen-grotesk-latin-400-normal.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --bg:     #f4efe4;   /* warm cream */
  --ink:    #0d1b2a;   /* deep navy */
  --accent: #f9c027;   /* Miró yellow */
  --blue:   #4a8fc4;   /* Miró blue */
  --red:    #d94f2b;   /* Miró red */
  --mid:    #4e5a6a;   /* blue-toned mid */
  --light:  #9aa5b4;   /* muted blue-gray */
  --line:   #ddd5c6;   /* warm divider */
  --display: 'Familjen Grotesk', 'Helvetica Neue', sans-serif;
}

html { scroll-behavior: smooth; overflow-x: clip; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* SKIP LINK */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.6rem 1.2rem;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  z-index: 200;
}
.skip-link:focus { top: 1rem; }

/* FOCUS */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Belt-and-braces: some elements set their own display, which would
   otherwise defeat the hidden attribute used by the coming-soon gate */
[hidden] { display: none !important; }

/* ==========================================================================
   COMING-SOON GATE (temporary — removed at launch)
   ========================================================================== */

.gate {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
  overflow: hidden;
}

.gate-content { position: relative; z-index: 1; }

.gate-art { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

.gate-shape { position: absolute; }
.gate-sun  { top: 12%; right: 6%;  width: clamp(90px, 12vw, 160px); height: auto; }
.gate-star { bottom: 18%; right: 24%; width: clamp(34px, 5vw, 60px); height: auto; }
.gate-dot  { top: 30%; left: 55%; width: 12px; height: 12px; }

.gate-tag {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 2rem;
}

.gate-tag::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
}

.gate-title {
  font-family: var(--display);
  font-size: clamp(3rem, 9vw, 7rem);
  font-weight: normal;
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}

.gate-sub {
  font-size: 0.8rem;
  color: var(--mid);
  line-height: 1.9;
  max-width: 44ch;
  margin-bottom: 2.2rem;
}

.gate-links { display: flex; gap: 1rem; flex-wrap: wrap; }

.gate-form { margin-top: 3.5rem; max-width: 320px; }

.gate-label {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 0.7rem;
}

.gate-row { display: flex; }

.gate-input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-family: inherit;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-right: none;
}

.gate-input::placeholder { color: var(--light); }

.gate-btn {
  padding: 0.75rem 1.4rem;
  font-size: 0.62rem;
  font-family: inherit;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}

.gate-btn:hover { background: var(--ink); color: var(--bg); }

.gate-error {
  margin-top: 0.8rem;
  font-size: 0.7rem;
  color: var(--red);
}

/* ==========================================================================
   NAV
   ========================================================================== */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem 2.5rem;
  background: rgba(244, 239, 228, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.nav-name {
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
}

/* Scroll-progress motif — decorative, revealed by JS in bold mode only */
.nav-progress {
  display: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.nav-progress.active { display: block; }

.nav-links {
  display: flex;
  gap: 1.8rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--light);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--blue); }

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10rem 2.5rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-content { position: relative; z-index: 1; }

.hero-tag {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 2rem;
}

.hero-tag::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: normal;
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 2.5rem;
}

.hero h1 .dim { color: var(--light); }

/* JS text-splitting wraps words (.w) and characters (.c) for reveals */
.hero h1 .w { display: inline-block; }
.hero h1 .c { display: inline-block; }

.hero-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-desc {
  font-size: 0.8rem;
  color: var(--mid);
  line-height: 1.9;
  max-width: 38ch;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.8rem;
  border: 1px solid var(--ink);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
  flex-shrink: 0;
}

.hero-cta:hover { background: var(--ink); color: var(--bg); }
.hero-cta svg { transition: transform 0.25s; }
.hero-cta:hover svg { transform: translateX(4px); }

/* --- Hero constellation of Miró shapes (decorative) ------------------- */

.hero-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.shape { position: absolute; pointer-events: none; }

/* Inner geometry animates independently of the outer svg (drift/orbit/
   breathing vs. cursor parallax) — center transforms on the shape itself */
.shape circle, .shape path, .shape g {
  transform-box: fill-box;
  transform-origin: center;
}

.shape-sun      { top: 16%;  right: 4%;   width: clamp(90px, 12vw, 170px);  height: auto; }
.shape-orbit    { top: 52%;  right: 14%;  width: clamp(70px, 9vw, 130px);   height: auto; }
.shape-star     { top: 10%;  left: 46%;   width: clamp(36px, 5vw, 64px);    height: auto; }
.shape-crescent { bottom: 14%; right: 30%; width: clamp(40px, 6vw, 76px);   height: auto; }
.shape-blob     { bottom: -7%; left: -4%;  width: clamp(80px, 11vw, 150px); height: auto; }
.shape-dot      { top: 34%;  right: 26%;  width: 14px; height: 14px; }
.shape-squiggle { top: 70%;  left: 34%;   width: clamp(70px, 10vw, 140px);  height: auto; }

/* Calm mode keeps only two quiet shapes; JS never activates the rest */
[data-motion="calm"] .shape-star,
[data-motion="calm"] .shape-crescent,
[data-motion="calm"] .shape-dot,
[data-motion="calm"] .shape-squiggle,
[data-motion="calm"] .shape-orbit { display: none; }

/* ==========================================================================
   SHARED SECTION PIECES
   ========================================================================== */

.rule {
  width: 100%;
  height: 1px;
  background: var(--line);
  transform-origin: left center;
}

.section-label {
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 4rem;
  display: block;
}

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 2.5rem;
  position: relative;
}

/* Anchored sections stop below the fixed nav */
.section, .statement { scroll-margin-top: 4.2rem; }

.section-title {
  font-family: var(--display);
  font-weight: normal;
  line-height: 0.95;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   ABOUT
   ========================================================================== */

.about-section h2 {
  font-size: clamp(3rem, 7vw, 6rem);
  margin-bottom: 3.5rem;
}

.about-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.about-bio p {
  font-size: 0.82rem;
  line-height: 1.95;
  color: var(--mid);
  margin-bottom: 1.4rem;
}

.about-bio p:last-child { margin-bottom: 0; }

.about-aside { position: relative; }

.about-highlight {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: normal;
  line-height: 1.2;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding-left: 1.6rem;
  transform-origin: top center;
}

.about-star {
  display: block;
  width: 44px;
  height: auto;
  margin-top: 2rem;
  margin-left: 1.6rem;
}

/* ==========================================================================
   PILLARS
   ========================================================================== */

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
}

.pillar {
  padding: 2.5rem 2rem 2.5rem 0;
  border-right: 1px solid var(--line);
}

.pillar:last-child { border-right: none; padding-right: 0; }
.pillar:not(:first-child) { padding-left: 2rem; }

.pillar-glyph {
  display: block;
  width: 34px;
  height: 34px;
  margin-bottom: 1.6rem;
}

.pillar-index {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 2rem;
  text-transform: uppercase;
}

.pillar h3 {
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: normal;
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
}

.pillar p {
  font-size: 0.76rem;
  line-height: 1.85;
  color: var(--mid);
}

/* ==========================================================================
   STATEMENT
   ========================================================================== */

.statement {
  position: relative;
  background: var(--ink);
  color: var(--bg);
  padding: 8rem 2.5rem;
  text-align: center;
  overflow: hidden;
}

.statement p {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: normal;
  line-height: 1.05;
  max-width: 800px;
  margin: 0 auto;
}

.statement p .w { display: inline-block; }

.statement-shape { position: absolute; pointer-events: none; z-index: 0; }
.statement-disc { top: -12%; left: 6%;  width: clamp(120px, 16vw, 220px); height: auto; }
.statement-arc  { bottom: -18%; right: 8%; width: clamp(140px, 18vw, 260px); height: auto; }

[data-motion="calm"] .statement-shape { display: none; }

/* ==========================================================================
   PORTFOLIO
   ========================================================================== */

.portfolio-section h2 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin-bottom: 3rem;
}

.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  border-top: 1px solid var(--line);
}

.project {
  border-right: 1px solid var(--line);
}

.project:last-child { border-right: none; }

.project-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  height: 100%;
  padding: 2.5rem 2rem 2.5rem 0;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease;
}

.project:not(:first-child) .project-card { padding-left: 2rem; }
.project:last-child .project-card { padding-right: 0; }

.project-card:hover,
.project-card:focus-visible { transform: translateY(-5px); }

.project-index {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--red);
  text-transform: uppercase;
}

.project-card h3 {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: normal;
  line-height: 1.05;
  transition: color 0.2s;
}

.project-card:hover h3,
.project-card:focus-visible h3 { color: var(--blue); }

.project-card p {
  font-size: 0.76rem;
  line-height: 1.85;
  color: var(--mid);
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.tag {
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mid);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}

.project-card svg { transition: transform 0.25s; }
.project-card:hover svg,
.project-card:focus-visible svg { transform: translateX(4px); }

/* ==========================================================================
   WRITING
   ========================================================================== */

.writing-section h2 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin-bottom: 1.2rem;
}

.writing-intro {
  font-size: 0.78rem;
  color: var(--mid);
  line-height: 1.9;
  max-width: 44ch;
  margin-bottom: 3.5rem;
}

.essays {
  list-style: none;
  margin-bottom: 4rem;
}

.essays li { border-top: 1px solid var(--line); }
.essays li:last-child { border-bottom: 1px solid var(--line); }

.essay-card {
  display: grid;
  grid-template-columns: 9rem 1fr auto;
  gap: 2rem;
  align-items: baseline;
  padding: 1.8rem 0;
  text-decoration: none;
  color: inherit;
}

.essay-card time {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--light);
}

.essay-card h3 {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: normal;
  line-height: 1.1;
  margin-bottom: 0.45rem;
  transition: color 0.2s;
}

.essay-card:hover h3,
.essay-card:focus-visible h3 { color: var(--blue); }

.essay-card p {
  font-size: 0.74rem;
  line-height: 1.8;
  color: var(--mid);
  max-width: 62ch;
}

.essay-arrow {
  color: var(--light);
  transition: transform 0.25s, color 0.2s;
}

.essay-card:hover .essay-arrow,
.essay-card:focus-visible .essay-arrow { transform: translateX(4px); color: var(--blue); }

.subscribe-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  padding: 2.5rem;
}

.subscribe-box h3 {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: normal;
  line-height: 1.05;
  margin-bottom: 0.6rem;
}

.subscribe-box > div:first-child p {
  font-size: 0.74rem;
  color: var(--mid);
  line-height: 1.85;
  max-width: 38ch;
}

.substack-embed {
  border: none;
  background: transparent;
  width: 480px;
  max-width: 100%;
  display: block;
}

.substack-fallback {
  display: block;
  margin-top: 1rem;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--light);
  text-decoration: none;
  transition: color 0.2s;
}

.substack-fallback:hover { color: var(--ink); }

/* ==========================================================================
   CONTACT
   ========================================================================== */

.contact-section h2 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin-bottom: 3rem;
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
}

.contact-link {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 2rem 2rem 2rem 0;
  border-right: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.contact-link:last-child { border-right: none; padding-right: 0; }
.contact-link:not(:first-child) { padding-left: 2rem; }

.contact-label {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--light);
  transition: color 0.2s;
}

.contact-handle {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: normal;
  line-height: 1;
  color: var(--ink);
  transition: color 0.2s;
}

.contact-link:hover .contact-label,
.contact-link:hover .contact-handle { color: var(--blue); }

.contact-sun {
  position: absolute;
  right: 2.5rem;
  top: 4.5rem;
  width: clamp(70px, 9vw, 120px);
  height: auto;
  pointer-events: none;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer {
  border-top: 1px solid var(--line);
  padding: 2rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

footer span, footer a {
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--light);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover { color: var(--ink); }

/* ==========================================================================
   404 PAGE
   ========================================================================== */

.page-404 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-404 nav { position: static; }

.page-404 main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.page-404 .section-label { margin-bottom: 2rem; }

.page-404 h1 {
  font-family: var(--display);
  font-size: clamp(5rem, 18vw, 14rem);
  font-weight: normal;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 2rem;
}

.page-404 h1 span { color: var(--light); }

.page-404 main > p {
  font-size: 0.82rem;
  color: var(--mid);
  line-height: 1.9;
  max-width: 38ch;
  margin-bottom: 2.5rem;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.8rem;
  border: 1px solid var(--ink);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: background 0.25s, color 0.25s;
  align-self: flex-start;
}

.home-link:hover { background: var(--ink); color: var(--bg); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
  .nav-links { gap: 1.2rem; }
  .nav-links a { font-size: 0.6rem; }
}

@media (max-width: 640px) {
  nav { padding: 1.1rem 1rem; }
  .nav-name { font-size: 0.85rem; }
  .nav-progress { display: none; }
  .nav-progress.active { display: none; }
  .nav-links { gap: 0.7rem; }
  .nav-links a { font-size: 0.52rem; letter-spacing: 0.08em; }

  .section { padding: 5rem 1.5rem; }
  .hero { padding: 8rem 1.5rem 4rem; }
  .hero h1 { font-size: clamp(2.7rem, 9vw, 8rem); }

  /* Quieter hero constellation on small screens */
  .shape-orbit, .shape-squiggle, .shape-dot { display: none; }
  .shape-sun  { top: 10%; right: -6%; }
  .shape-blob { bottom: 8%; left: -12%; }

  .pillars { grid-template-columns: 1fr; }
  .pillar { border-right: none; border-bottom: 1px solid var(--line); padding: 2rem 0 !important; }
  .pillar:last-child { border-bottom: none; }

  .about-body { grid-template-columns: 1fr; gap: 2.5rem; }

  .projects { grid-template-columns: 1fr; }
  .project { border-right: none; border-bottom: 1px solid var(--line); }
  .project:last-child { border-bottom: none; }
  .project-card { padding: 2rem 0 !important; }

  .essay-card {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    padding: 1.6rem 0;
  }
  .essay-arrow { display: none; }

  .subscribe-box { padding: 1.8rem 1.5rem; }

  .contact-links { grid-template-columns: 1fr; }
  .contact-link {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 1.5rem 0 !important;
  }
  .contact-link:last-child { border-bottom: none; }

  .contact-sun { right: 1rem; top: 3.5rem; opacity: 0.5; }
}
