/* ============================================
   TOKENS
   ============================================ */
:root {
  --bg:        #FAFAF8;
  --bg-alt:    #F1F0EA;
  --ink:       #16181D;
  --ink-soft:  #4B4E57;
  --line:      #DEDBD3;
  --navy:      #1F3A5F;
  --pitch:     #2E5339;
  --gold:      #B8863B;

  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --max-width: 1120px;
  --gutter: clamp(1.5rem, 4vw, 3rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; color: var(--ink-soft); max-width: 62ch; }

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* subtle paper grain, static, no motion */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================
   HEADER / NAV
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.main-nav { display: flex; gap: 2rem; }
.main-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.main-nav a:hover { color: var(--ink); border-color: var(--gold); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
}

/* ============================================
   HERO
   ============================================ */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem); }

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--pitch);
  margin-bottom: 1rem;
}

.hero-text h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  letter-spacing: -0.02em;
  color: var(--navy);
  margin-bottom: 0.4em;
}

.hero-lede {
  font-size: 1.08rem;
  max-width: 46ch;
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: #16304F; }

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--navy); }

/* Scoreboard */
.scoreboard {
  border: 1px solid var(--line);
  background: #fff;
  padding: 1.75rem;
  border-radius: 4px;
}

.scoreboard-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
}

.scoreboard-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--navy);
  white-space: nowrap;
}

.scoreboard-label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: right;
}

.scoreboard-divider {
  height: 1px;
  background: var(--line);
}

/* ============================================
   SECTIONS (shared)
   ============================================ */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  color: var(--navy);
  margin-bottom: 1.75rem;
  letter-spacing: -0.01em;
}

.section-intro {
  max-width: 62ch;
  font-size: 1.02rem;
  margin-bottom: 2.5rem;
}

/* ============================================
   EDUCATION / TRANSCRIPT
   ============================================ */
.record {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
}
.record-compact { padding: 1.5rem 0; }

.record-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.record-head h3 { font-size: 1.25rem; margin-bottom: 0.2em; }
.record-sub { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }

.record-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  flex-shrink: 0;
}

.record-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.record-score {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
}

.transcript {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.transcript th {
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.transcript td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.transcript td:first-child,
.transcript th:first-child { padding-left: 0; width: 3.5rem; }

.transcript td:nth-child(2) {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
}

.table-note {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

/* ============================================
   CREDENTIALS
   ============================================ */
.credential {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: start;
  border-top: 1px solid var(--line);
  padding: 2rem 0;
}

.credential img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.credential-desc { max-width: 68ch; margin-top: 0.75rem; }

/* ============================================
   PROJECTS
   ============================================ */
.project {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.5rem;
  padding: 2.25rem 0;
  border-top: 1px solid var(--line);
}

.project-num {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--line);
}

.project-body h3 {
  font-size: 1.35rem;
  color: var(--navy);
}

.project-desc { max-width: 68ch; }

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

.project-tags li {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--pitch);
  background: #fff;
}

/* ============================================
   ATHLETICS
   ============================================ */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}

.achievement {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}

.achievement img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.achievement-body { padding: 1.25rem 1.4rem 1.5rem; }

.achievement-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.achievement-body h3 { font-size: 1.08rem; margin-bottom: 0.35em; }
.achievement-body p { font-size: 0.92rem; margin: 0; }

/* Compact variant used for the de-emphasized Athletics section */
.section-title-small { font-size: clamp(1.3rem, 2.8vw, 1.6rem); margin-bottom: 0.6rem; }
.section-intro-small { font-size: 0.92rem; margin-bottom: 1.75rem; }

.achievement-grid-compact {
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 0;
}

.achievement-compact img { aspect-ratio: 1; }
.achievement-compact .achievement-body { padding: 0.9rem 1rem 1.1rem; }
.achievement-compact .achievement-body h3 { font-size: 0.92rem; margin: 0; }
.achievement-compact .achievement-tag { font-size: 0.66rem; margin-bottom: 0.4rem; }

/* ============================================
   SKILLS
   ============================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem 2rem;
}

.skill-group h3 {
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 0.9rem;
}

.chip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chip-list li {
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
}

/* ============================================
   CONTACT
   ============================================ */
.contact-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.form-row input,
.form-row textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--navy);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-submit {
  align-self: flex-start;
  margin-top: 0.25rem;
  cursor: pointer;
}
.form-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.form-status {
  min-height: 1.2em;
  font-size: 0.88rem;
  margin: 0;
}
.form-status-success { color: var(--pitch); }
.form-status-error { color: #A6402F; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-decoration: none;
  background: #fff;
  transition: border-color 0.15s ease;
}
.contact-item:hover { border-color: var(--navy); }

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.contact-value {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--navy);
  word-break: break-word;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.footer-inner a { text-decoration: none; color: var(--ink-soft); }
.footer-inner a:hover { color: var(--navy); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }

  .main-nav.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 1rem var(--gutter) 1.5rem;
    gap: 1rem;
  }

  .hero-inner { grid-template-columns: 1fr; }
  .achievement-grid { grid-template-columns: 1fr; }
  .achievement-grid-compact { grid-template-columns: repeat(2, 1fr); }
  .credential { grid-template-columns: 1fr; }
  .credential img { max-width: 240px; }
  .skills-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; gap: 2rem; }
  .project { grid-template-columns: 1fr; }
  .project-num { font-size: 1.2rem; }
  .record-head { flex-direction: column; }
  .record-meta { align-items: flex-start; }
  .scoreboard-label { text-align: left; }
}

@media (max-width: 480px) {
  .transcript { font-size: 0.78rem; }
  .transcript td, .transcript th { padding: 0.5rem 0.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
