/* ==========================================================================
   Dashwood Portfolio — stylesheet
   Table of contents:
     1. Tokens (edit colours/fonts here)
     2. Reset
     3. Layout helpers
     4. Typography
     5. Header / Nav
     6. Hero
     7. Section scaffolding
     8. About
     9. Skills
     10. Projects
     11. Experience (timeline)
     12. Education
     13. Contact
     14. Footer
     15. Buttons / tags / links (shared components)
     16. Scroll reveal + reduced motion
     17. Responsive breakpoints
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* colour palette: dark green / charcoal / off-white */
  --paper: #F6F4EC;
  --paper-alt: #EEEAE0;
  --surface: #FFFFFF;

  --ink: #1B211D;
  --ink-soft: #54594F;

  --forest: #123024;
  --forest-mid: #1F4632;
  --accent: #2C5940;
  --accent-soft: #9FC2AC;
  --tag-bg: #E4EBE3;

  --line: rgba(18, 48, 36, 0.14);
  --shadow: rgba(18, 48, 36, 0.16);

  /* type */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  /* rhythm */
  --container-w: 1120px;
  --radius: 10px;
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  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; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
h1, h2 { font-family: var(--font-display); font-weight: 600; }
h3, h4 { font-family: var(--font-body); font-weight: 600; }
p { margin: 0; }

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

.skip-link {
  position: absolute;
  left: 1rem; top: -60px;
  background: var(--forest);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  z-index: 1000;
  transition: top var(--transition);
}
.skip-link:focus { top: 1rem; }

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

/* ---------- 3. Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- 4. Typography ---------- */
.eyebrow, .section-kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- 5. Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 244, 236, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding-block: 0.25rem;
  transition: color var(--transition);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  transition: right var(--transition);
}
.nav-link:hover,
.nav-link.is-active { color: var(--ink); }
.nav-link:hover::after,
.nav-link.is-active::after { right: 0; }

.nav-link--cta {
  border: 1px solid var(--forest);
  border-radius: 999px;
  padding: 0.45rem 1.05rem;
  color: var(--forest);
}
.nav-link--cta::after { display: none; }
.nav-link--cta:hover { background: var(--forest); color: var(--paper); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  padding: 0;
}
.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 6. Hero ---------- */
.hero {
  padding-block: clamp(4rem, 10vw, 7.5rem) clamp(3.5rem, 8vw, 6rem);
  border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: 760px; }
.hero-title {
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  line-height: 1.05;
  margin-block: 0.6rem 1.25rem;
  color: var(--forest);
}
.hero-lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 58ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.25rem;
}

/* ---------- 7. Section scaffolding ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section--tint { background: var(--paper-alt); }
.section-head { margin-bottom: 2.75rem; max-width: 640px; }
.section-title {
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  margin-top: 0.5rem;
  color: var(--forest);
}

/* ---------- 8. About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}
.about-text { color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- 9. Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.skill-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 24px -16px var(--shadow);
}
.skill-card-title {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: var(--forest);
}

/* ---------- 10. Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.75rem;
}
.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 36px -20px var(--shadow);
}
.project-media {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, var(--forest) 0%, var(--forest-mid) 100%);
  color: var(--accent-soft);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 1rem;
}
.project-media { position: relative; overflow: hidden; padding: 0; }
.project-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.project-media .media-placeholder { padding: 1rem; }
.media-placeholder-sub {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  opacity: 0.75;
}
.project-body {
  padding: 1.5rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}
.project-title { font-size: 1.2rem; color: var(--ink); }
.project-desc { color: var(--ink-soft); font-size: 0.96rem; }
.tag-list--sm { margin-top: auto; padding-top: 0.5rem; }
.project-links { display: flex; gap: 1.5rem; padding-top: 0.25rem; }

/* ---------- 11. Experience (timeline) ---------- */
.timeline { position: relative; max-width: 760px; }
.timeline-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 1.5rem;
}
.timeline-marker {
  width: 12px; height: 12px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--tag-bg);
}
.timeline-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; }
.timeline-role { font-size: 1.3rem; color: var(--forest); }
.timeline-org { color: var(--accent); font-weight: 500; }
.timeline-dates {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-block: 0.4rem 1rem;
}
.timeline-list { display: flex; flex-direction: column; gap: 0.6rem; }
.timeline-list li {
  position: relative;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}
.timeline-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.6em;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

/* ---------- 12. Education ---------- */
.education-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 760px;
}
.education-heading { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: baseline; margin-bottom: 0.75rem; }
.education-degree { font-size: 1.3rem; color: var(--forest); }
.education-dates { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); }
.education-desc { color: var(--ink-soft); }

/* ---------- 13. Contact ---------- */
.section--dark {
  background: var(--forest);
  color: var(--paper);
}
.section-head--dark .section-title { color: var(--paper); }
.section-head--dark .section-kicker { color: var(--accent-soft); }
.contact-intro { color: rgba(246, 244, 236, 0.78); font-size: 1.05rem; max-width: 56ch; margin-top: 1rem; }

.contact-grid { max-width: 480px; }
.contact-links { display: flex; flex-direction: column; gap: 1rem; }
.contact-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(246, 244, 236, 0.2);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.contact-link:hover {
  border-color: var(--accent-soft);
  background: rgba(246, 244, 236, 0.06);
  transform: translateX(4px);
}
.contact-link-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-soft);
}
.contact-link-value { font-size: 1.02rem; }

/* ---------- 14. Footer ---------- */
.site-footer { background: var(--forest); color: rgba(246, 244, 236, 0.65); border-top: 1px solid rgba(246, 244, 236, 0.12); }
.footer-inner {
  padding-block: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: 0.88rem;
}
.back-to-top { color: var(--accent-soft); transition: color var(--transition); }
.back-to-top:hover { color: var(--paper); }

/* ---------- 15. Buttons / tags / links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.96rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--forest);
  color: var(--paper);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -14px var(--shadow);
}
.btn-ghost {
  background: transparent;
  color: var(--forest);
  border-color: var(--forest);
}
.btn-ghost:hover {
  background: var(--forest);
  color: var(--paper);
  transform: translateY(-2px);
}
.section--dark .btn-primary { background: var(--accent-soft); color: var(--forest); }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--tag-bg);
  color: var(--accent);
  padding: 0.32rem 0.7rem;
  border-radius: 6px;
}
.tag-list--sm .tag { font-size: 0.74rem; }

.link-arrow {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.link-arrow span { transition: transform var(--transition); }
.link-arrow:hover span { transform: translateX(3px); }

/* ---------- 16. Scroll reveal + reduced motion ---------- */
.reveal {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 600ms ease, transform 600ms ease;
  }
  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- 17. Responsive ---------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100vh - 72px);
    height: calc(100dvh - 72px);
    overflow-y: auto;
    background: var(--paper);
    padding: 2rem 24px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
  }
  .primary-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .primary-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  .nav-link { font-size: 1.15rem; }
  .nav-toggle { display: flex; }

  .hero { padding-block: 3rem 2.75rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }

  .timeline-item { grid-template-columns: 12px 1fr; gap: 1rem; }
}

@media (max-width: 480px) {
  .container { padding-inline: 18px; }
  .header-inner { height: 64px; }
  .primary-nav {
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
  }
}
