/* ============================================================
   Keona Arneson — portfolio styles
   Design tokens first; change the palette here and everything
   downstream follows.
   ============================================================ */

:root {
  --bg: #FAF9F7;
  --surface: #FFFFFF;
  --ink: #1C1917;
  --ink-soft: #57534E;
  --ink-faint: #8A837E;
  --line: #E5E0D8;
  --line-soft: #EDE9E2;
  --chip-bg: #F3F0EA;

  --accent: #B45309;        /* large text, borders, decoration */
  --accent-text: #92400E;   /* small text — AA on --bg */
  --accent-hover: #9A4708;
  --accent-contrast: #FFFFFF;

  --header-bg: rgba(250, 249, 247, 0.85);
  --grid-line: rgba(28, 25, 23, 0.05);
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.05), 0 14px 34px -18px rgba(28, 25, 23, 0.18);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Space Grotesk", var(--font-body);
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

/* ---------- reset & base ---------- */

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

* { margin: 0; }

html {
  color-scheme: light;
}

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, object { display: block; max-width: 100%; }

a { color: inherit; }

::selection { background: rgba(180, 83, 9, 0.22); }

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

.container {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 36px);
}

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

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 0 0 10px 10px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.muted { color: var(--ink-soft); }

/* ---------- header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.nav-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.02rem;
  text-decoration: none;
  color: var(--ink);
}
.brand-bg { fill: var(--ink); }
.brand-wave { stroke: var(--bg); }

.site-nav { position: relative; }

.nav-menu {
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 0;
}

.nav-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-menu a:hover { color: var(--ink); background: var(--chip-bg); }
.nav-menu a.active { color: var(--accent-text); }

.nav-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-toggle:hover { color: var(--ink); border-color: var(--ink-faint); }

.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-toggle { display: grid; }

  .nav-menu {
    display: none;
    position: absolute;
    top: calc(100% + 14px);
    right: -8px;
    flex-direction: column;
    min-width: 190px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
  }
  .site-nav.open .nav-menu { display: flex; }
  .nav-menu a { padding: 10px 14px; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: clamp(84px, 14vh, 150px) 0 64px;
  overflow: hidden;
}

/* faint engineering-grid texture, fading out toward the bottom */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to right, var(--grid-line) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(to bottom, var(--grid-line) 0 1px, transparent 1px 40px);
  -webkit-mask-image: linear-gradient(to bottom, black 20%, transparent 95%);
  mask-image: linear-gradient(to bottom, black 20%, transparent 95%);
  pointer-events: none;
}

.hero .container { position: relative; }

.hero h1 {
  margin-top: 18px;
  font-family: var(--font-head);
  font-size: clamp(2.7rem, 7vw, 4.4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.hero-tagline {
  margin-top: 16px;
  font-family: var(--font-head);
  font-size: clamp(1.12rem, 2.6vw, 1.45rem);
  font-weight: 500;
}
.hero-tagline .sep { color: var(--accent); padding-inline: 2px; }

.hero-intro {
  margin-top: 18px;
  max-width: 56ch;
  font-size: 1.06rem;
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-now {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-size: 0.94rem;
  color: var(--ink-soft);
}
.now-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(180, 83, 9, 0.15);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 28px;
  margin-top: 52px;
}
.stat {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.stat dd {
  order: 1;
  font-family: var(--font-head);
  font-size: 1.55rem;
  font-weight: 600;
}
.stat dt {
  order: 2;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

@media (max-width: 860px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- buttons & links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-contrast);
}

.btn .ext { font-weight: 400; opacity: 0.7; }

.text-link {
  color: var(--accent-text);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- sections ---------- */

.section { padding: clamp(68px, 10vh, 112px) 0; }

section[id] { scroll-margin-top: 84px; }

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(26px, 5vh, 42px);
}
.section-head h2 {
  font-family: var(--font-head);
  font-size: clamp(1.65rem, 3.4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.section-note {
  margin: -14px 0 32px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
}

.about-text p + p { margin-top: 16px; }
.about-text { font-size: 1.03rem; }

.about-side {
  border-left: 1px solid var(--line);
  padding-left: 36px;
}

.side-label { display: block; margin: 28px 0 14px; }
.side-label:first-child { margin-top: 4px; }

.focus-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
  font-size: 0.94rem;
  color: var(--ink-soft);
}
.focus-list strong { color: var(--ink); font-weight: 600; }

.chip-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--ink-soft);
}

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .about-side {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 28px;
  }
}

/* ---------- projects ---------- */

.project-list {
  display: grid;
  gap: 26px;
}

.project-card {
  display: grid;
  grid-template-columns: 330px 1fr;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.project-media {
  display: grid;
  place-items: center;
  padding: 22px;
  border-right: 1px solid var(--line-soft);
  background: var(--chip-bg);
  min-height: 230px;
}
.project-media.has-image { padding: 0; }
.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-placeholder {
  display: grid;
  place-items: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 186px;
  padding: 20px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  color: var(--ink-faint);
  text-align: center;
}
.media-placeholder svg { opacity: 0.65; }
.media-placeholder span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.project-body { padding: 26px 28px 24px; }

.project-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.project-meta .meta-text {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.status-chip {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 3px 9px;
}

.project-card h3 {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-summary {
  margin-top: 6px;
  font-weight: 500;
  color: var(--ink);
}

.project-desc {
  margin-top: 10px;
  font-size: 0.96rem;
  color: var(--ink-soft);
}

.project-tools { margin-top: 18px; }
.project-tools .chip { font-size: 0.7rem; padding: 5px 10px; }

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 16px;
}
.project-links .link-note {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--ink-faint);
  margin-left: 6px;
}
.coming-soon {
  font-size: 0.88rem;
  color: var(--ink-faint);
  font-style: italic;
}

@media (max-width: 900px) {
  .project-card { grid-template-columns: 1fr; }
  .project-media {
    min-height: 0;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
  }
  .media-placeholder { min-height: 140px; }
  .project-body { padding: 22px 22px 20px; }
}

/* ---------- skills ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 20px;
}

.skill-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  background: var(--surface);
}
.skill-group h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 14px;
}

/* ---------- resume ---------- */

.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.resume-embed {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.resume-embed object {
  width: 100%;
  height: 860px;
}
.embed-fallback { padding: 28px; }

.resume-mobile-note {
  display: none;
  margin-top: 14px;
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .resume-embed { display: none; }
  .resume-mobile-note { display: block; }
}

/* ---------- contact ---------- */

.contact-lede {
  max-width: 52ch;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.contact-email {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
}

.email-big {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 3.4vw, 1.85rem);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  overflow-wrap: anywhere;
}
.email-big:hover { color: var(--accent-text); }

.contact-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 28px;
}

.contact-loc { margin-top: 30px; font-size: 0.92rem; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 42px;
}
.footer-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.footer-tag {
  color: var(--ink-faint);
  letter-spacing: 0.1em;
}

/* ---------- reveal-on-scroll ---------- */
/* Only applies when JS is running (html.js); without JS everything is visible. */

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
}
html.js [data-reveal].revealed {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.55s ease,
    transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
  transition-delay: calc(var(--stagger, 0) * 70ms);
}

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .btn, .project-card { transition: none; }
  .btn:hover, .project-card:hover { transform: none; }
}
