/* JOSGREVAR — Quiet Signal
   Dark-first personal site template. System fonts only. No CDNs. */

:root,
html[data-theme="dark"] {
  --bg: #0B1012;
  --surface: #121A1D;
  --text: #EDF2F1;
  --muted: #A8B6B2;
  --accent: #A6E8CE;
  --border: #2B3935;
  --control: #63776F;
  --cta-text: #0B1012;
  --grid-line: rgba(237, 242, 241, 0.04);
  --halo: rgba(166, 232, 206, 0.06);
  --arc: rgba(166, 232, 206, 0.65);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #F4F6F3;
  --surface: #FFFFFF;
  --text: #16221E;
  --muted: #52645C;
  --accent: #17634B;
  --border: #D2DDD6;
  --control: #73867B;
  --cta-text: #FFFFFF;
  --grid-line: rgba(22, 34, 30, 0.04);
  --halo: rgba(23, 99, 75, 0.06);
  --arc: rgba(23, 99, 75, 0.65);
  color-scheme: light;
}

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

html {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 100%;
  hanging-punctuation: first last;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
}

h1, h2, h3, p, dl, dt, dd {
  margin: 0;
}

a {
  color: inherit;
}

:focus {
  outline: none;
}

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

/* Layout shell */

.wrap {
  width: min(1120px, calc(100% - 96px));
  margin-inline: auto;
}

@media (max-width: 1023px) {
  .wrap {
    width: min(1120px, calc(100% - 64px));
  }
}

@media (max-width: 767px) {
  .wrap {
    width: min(1120px, calc(100% - 48px));
  }
}

@media (max-width: 379px) {
  .wrap {
    width: calc(100% - 40px);
  }
}

/* Skip link */

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

/* Type utilities */

.eyebrow,
.label-text,
.status,
.placeholder-tag {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Header */

.site-header {
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px 32px;
  min-height: 80px;
  flex-wrap: wrap;
  padding-block: 12px;
}

.wordmark {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.nav > a {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  min-height: 44px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
}

.wordmark:hover,
.nav > a:hover,
.back-to-top:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  margin: 0;
  border: 1px solid var(--control);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: color 160ms var(--ease), border-color 160ms var(--ease), background-color 160ms var(--ease);
}

.theme-toggle[hidden] {
  display: none;
}

.theme-icon {
  flex: none;
}

html[data-theme="dark"] .theme-icon-moon,
html[data-theme="light"] .theme-icon-sun {
  display: none;
}

@media (max-width: 767px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Hero */

.hero-inner {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  align-items: center;
  padding-top: 64px;
}

.hero-copy {
  grid-column: 1 / 8;
  min-width: 0;
}

.hero-visual {
  grid-column: 9 / 13;
  min-width: 0;
}

.eyebrow {
  color: var(--muted);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.75rem, 1.4rem + 5.2vw, 4.75rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.lede {
  font-size: clamp(1.25rem, 1.15rem + 0.4vw, 1.375rem);
  font-weight: 400;
  line-height: 1.6;
  color: var(--muted);
  max-width: 34ch;
  margin-bottom: 28px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--cta-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.cta:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Portrait field */

.portrait-stage {
  position: relative;
  width: 100%;
  max-width: 357px;
  margin-inline: 0 auto;
}

.portrait {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
}

.halo {
  position: absolute;
  z-index: 0;
  width: 105.6%; /* 88% field × 1.2 */
  aspect-ratio: 1;
  left: 50%;
  top: 33.333%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--halo) 0%, transparent 70%);
  pointer-events: none;
}

.field {
  position: absolute;
  z-index: 1;
  width: 88%;
  aspect-ratio: 1;
  left: 50%;
  top: 33.333%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
}

.field-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
}

.field-arc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--arc);
  overflow: visible;
}

.arc-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw-arc 900ms 150ms var(--ease) forwards;
}

@keyframes draw-arc {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .arc-path {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* Band, rail, sections */

.band {
  position: relative;
  margin-top: 128px;
  padding-bottom: 128px;
}

.band-inner {
  position: relative;
}

.rail {
  position: absolute;
  left: 0;
  top: -64px;
  bottom: 0;
  width: 1px;
  background: var(--border);
  pointer-events: none;
}

.section {
  scroll-margin-top: 32px;
}

.section + .section {
  margin-top: 128px;
}

.section-inner {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.section-label {
  grid-column: 1 / 4;
  position: relative;
  padding-left: 20px;
  color: var(--muted);
}

.label-text {
  color: var(--muted);
}

.node {
  position: absolute;
  left: 0;
  top: 0.6em; /* vertical center of 12px × 1.6 line */
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--accent);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.section-body {
  grid-column: 4 / 13;
  min-width: 0;
}

.section-body h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.25rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  max-width: 60ch;
}

.section-body p {
  max-width: 60ch;
}

/* Reveals: content is visible by default. JS may mark offscreen sections. */

.section.is-pending .section-inner {
  opacity: 0;
  transform: translateY(8px);
}

.section.is-revealing .section-inner {
  opacity: 1;
  transform: none;
  transition: opacity 360ms var(--ease), transform 360ms var(--ease);
}

.section.is-pending .node {
  background: var(--bg);
  border-color: var(--control);
}

.section.is-revealing .node {
  background: var(--accent);
  border-color: var(--accent);
  transition: background-color 360ms var(--ease), border-color 360ms var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .section.is-pending .section-inner,
  .section.is-revealing .section-inner {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .section.is-pending .node,
  .section.is-revealing .node {
    background: var(--accent);
    border-color: var(--accent);
    transition: none;
  }
}

/* About */

.about-list {
  max-width: 100%;
}

.about-row {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 24px;
  padding-block: 24px;
  border-top: 1px solid var(--border);
}

.about-row:last-child {
  border-bottom: 1px solid var(--border);
}

.about-row dt {
  grid-column: 1 / 4;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.about-row dd {
  grid-column: 4 / 10;
  font-size: 17px;
  line-height: 1.65;
  max-width: 60ch;
}

.llc {
  margin-top: 48px;
  color: var(--muted);
}

/* Projects */

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.project-card .status {
  color: var(--muted);
  margin-bottom: 16px;
}

.project-card h3 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  margin-bottom: 16px;
}

.project-card p {
  max-width: none;
}

.project-card .meta-plain,
.project-card .meta-muted {
  margin-top: auto;
  padding-top: 24px;
}

.meta-plain {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.meta-muted {
  font-size: 17px;
  color: var(--muted);
}

/* Contact */

.placeholder {
  margin-top: 24px;
  padding: 24px;
  border: 1px dashed var(--control);
  border-radius: 8px;
  max-width: 60ch;
}

.placeholder-tag {
  color: var(--accent);
  margin-bottom: 20px;
}

.placeholder-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.placeholder-row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 16px;
  align-items: baseline;
}

.placeholder-key {
  font-size: 17px;
  color: var(--text);
}

.placeholder-val {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Footer */

.site-footer {
  background: var(--bg);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding-block: 32px;
  border-top: 1px solid var(--border);
}

.copyright {
  font-size: 14px;
  color: var(--muted);
}

.back-to-top {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

/* Breakpoints: tablet 768–1023, mobile <768 */

@media (max-width: 1023px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding-top: 64px;
  }

  .hero-copy,
  .hero-visual {
    grid-column: 1 / -1;
  }

  .hero-visual {
    margin-top: 40px;
  }

  .portrait-stage {
    max-width: 280px;
    margin-inline: 0;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .about-row {
    grid-template-columns: 120px 1fr;
    gap: 24px;
  }

  .about-row dt,
  .about-row dd {
    grid-column: auto;
  }
}

@media (max-width: 767px) {
  .hero-inner {
    padding-top: 40px;
  }

  .portrait-stage {
    max-width: 220px;
  }

  .portrait-stage .field {
    width: 196px;
  }

  .portrait-stage .halo {
    width: calc(196px * 1.2);
  }

  .hero-visual {
    margin-top: 40px;
  }

  .band {
    margin-top: 80px;
    padding-bottom: 80px;
  }

  .section + .section {
    margin-top: 80px;
  }

  .rail {
    display: none;
  }

  .section-inner {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .section-label,
  .section-body {
    grid-column: 1 / -1;
  }

  .section-label {
    padding-left: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
  }

  .node {
    position: static;
    transform: none;
    flex: none;
  }

  .about-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .placeholder-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
  }
}

/* Print */

@media print {
  :root,
  html,
  html[data-theme="dark"],
  html[data-theme="light"],
  body {
    background: #ffffff !important;
    color: #16221E !important;
    color-scheme: light;
  }

  .skip-link,
  .site-header,
  .theme-toggle,
  .hero-visual,
  .cta,
  .rail,
  .node,
  .halo,
  .field,
  .back-to-top {
    display: none !important;
  }

  .wrap {
    width: auto;
    max-width: none;
    margin: 0;
  }

  .hero-inner,
  .section-inner,
  .about-row,
  .project-grid,
  .placeholder-row,
  .footer-inner {
    display: block;
  }

  .hero-copy,
  .section-label,
  .section-body,
  .about-row dt,
  .about-row dd {
    grid-column: auto;
  }

  .band,
  .section + .section {
    margin-top: 36pt;
    padding-bottom: 0;
  }

  .hero-inner,
  .section-inner,
  .about-row,
  .project-card,
  .placeholder {
    opacity: 1 !important;
    transform: none !important;
  }

  .project-card {
    break-inside: avoid;
    border-color: #D2DDD6;
    background: #ffffff;
    margin-bottom: 16pt;
    padding: 0;
  }

  .placeholder {
    border-color: #73867B;
  }

  a[href^="http"]::after,
  a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
  }
}

.icon-arrow {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: none;
}

.contact-link { margin-top: 16px; font-size: 22px; }
.contact-link a { color: var(--accent); text-underline-offset: 4px; }

.qr-grid { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 24px; }
.qr { margin: 0; text-align: center; }
.qr img { display: block; width: 180px; height: 180px; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.qr figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
