/*
  =============================================
  styles.css — Ella Craghill Portfolio
  =============================================

  TABLE OF CONTENTS
  -----------------
  1.  Reset
  2.  Design Tokens (CSS Variables)
  3.  Base / Body
  4.  Scrollbar & Selection
  5.  Navigation
  6.  Hero
  7.  Shared Section Styles
  8.  Scroll Reveal
  9.  About
  10. Experience
  11. Education & Skills
  12. Interests
  13. Contact
  14. Footer
  15. Keyframe Animations
  16. Responsive (Mobile)
*/


/* ─────────────────────────────────────────
   1. RESET
   Remove default browser margin/padding.
   border-box makes width/padding math sane.
───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


/* ─────────────────────────────────────────
   2. DESIGN TOKENS
   All colors and fonts live here as CSS
   custom properties. Edit these to retheme
   the entire site in one place.

   To change the accent color:
     --accent is the main blue
     --accent-lt is a very light tint (used for backgrounds)
     --accent-mid is a softer mid-weight (used decoratively)
   All three should be updated together.
───────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:         #FDFAF6;   /* primary — warm off-white */
  --bg2:        #F5F0E8;   /* secondary — slightly warmer */
  --soft:       #EDE7DC;   /* fill color for placeholder areas */

  /* Text */
  --ink:        #1A1714;   /* near-black for headings and body */
  --muted:      #6B6259;   /* medium warm gray for secondary text */

  /* Borders */
  --border:     #DDD5C8;   /* subtle divider color */

  /* Accent — slate blue */
  --accent:     oklch(48% 0.11 240);
  --accent-lt:  oklch(95% 0.03 240);
  --accent-mid: oklch(75% 0.06 240);

  /* Typography */
  --serif: 'DM Serif Display', Georgia, serif;
  --sans:  'DM Sans', system-ui, sans-serif;
}


/* ─────────────────────────────────────────
   3. BASE / BODY
───────────────────────────────────────── */
html {
  scroll-behavior: smooth; /* animated anchor scrolling */
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased; /* crisper text on macOS/iOS */
}


/* ─────────────────────────────────────────
   4. SCROLLBAR & SELECTION
───────────────────────────────────────── */

/* Thin custom scrollbar — purely aesthetic */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Highlight color when user selects text */
::selection {
  background: var(--accent-lt);
  color: var(--accent);
}


/* ─────────────────────────────────────────
   5. NAVIGATION
   Fixed top bar. Starts transparent; gains
   a border + shadow once the user scrolls.
   The "scrolled" class is toggled by JS.
───────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 60px;
  background: rgba(253, 250, 246, 0.92);
  backdrop-filter: blur(12px); /* frosted-glass effect */
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}

nav.scrolled {
  border-color: var(--border);
  box-shadow: 0 1px 20px rgba(0,0,0,0.04);
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo img { display: block; }

/* Hamburger — hidden on desktop */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--ink);
  align-items: center;
  justify-content: center;
}
.icon-close { display: none; }
nav.open .icon-menu { display: none; }
nav.open .icon-close { display: block; }

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative; /* required for ::after underline */
}

/* Animated underline: starts collapsed (right:100%), expands on hover */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 100%;
  height: 1px;
  background: var(--accent);
  transition: right 0.25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { right: 0; }

/* "Contact" styled as a pill/button in the nav */
.nav-resume {
  border: 1.5px solid var(--accent) !important;
  color: var(--accent) !important;
  padding: 5px 14px;
  border-radius: 2px;
  font-size: 10px !important;
  letter-spacing: 0.1em !important;
}
.nav-resume::after { display: none !important; }
.nav-resume:hover { background: var(--accent-lt) !important; }


/* ─────────────────────────────────────────
   6. HERO
   Full-viewport opening section. Content
   is pinned to the bottom-left. The large
   name uses clamp() for fluid sizing.
───────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 48px;
  position: relative;
  overflow: hidden;
}

/* Centers hero content to match section-inner alignment */
.hero-content {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

/* Each hero element fades up on page load via CSS animation */
.hero-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.7s ease 0.2s forwards;
}

/* clamp(min, preferred, max) — scales with viewport width */
.hero-name {
  font-family: var(--serif);
  font-size: clamp(56px, 8vw, 100px);
  line-height: 0.95;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease 0.35s forwards;
}
.hero-name em {
  font-style: italic;
  color: var(--muted);
}

.hero-sub {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.7s ease 0.55s forwards;
}
.hero-sub-text {
  font-size: 14px;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.6;
}

/* Thin vertical rule between tagline and school info */
.hero-rule {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

.hero-school {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.hero-school strong { color: var(--ink); font-weight: 500; }

.hero-ctas {
  display: flex;
  gap: 12px;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.7s ease 0.7s forwards;
}

/* Shared button base */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-dark {
  background: var(--ink);
  color: var(--bg);
  border: 1.5px solid var(--ink);
}
.btn-dark:hover { background: #2e2a26; }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--ink); }



/* ─────────────────────────────────────────
   7. SHARED SECTION STYLES
───────────────────────────────────────── */
.section {
  padding: 96px 48px;
  border-top: 1px solid var(--border);
}

/* Constrains line length for readability on wide screens */
.section-inner {
  max-width: 860px;
  margin: 0 auto;
}

/* Section label: "ABOUT", "EXPERIENCE", etc.
   The trailing line comes from the ::after pseudo-element */
.sec-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sec-tag::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 120px;
}


/* ─────────────────────────────────────────
   8. SCROLL REVEAL
   Elements with .reveal start invisible.
   JS adds .visible when they enter the
   viewport, triggering this transition.
   Delay classes stagger sibling elements.
───────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }


/* ─────────────────────────────────────────
   9. ABOUT
───────────────────────────────────────── */
#about { background: var(--bg); }

/* Two columns: bio text left, photo right */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 60px;
  align-items: start;
}


.about-detail {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}
.about-detail strong { color: var(--ink); font-weight: 500; }

/* Photo + decorative offset frame */
.about-photo-wrap { position: relative; }
.about-photo {
  width: 200px;
  height: 240px;
  background: var(--soft);
  border: 1px solid var(--border);
  overflow: hidden;
}
.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
/* Decorative border offset behind the photo */
.about-photo-frame {
  position: absolute;
  top: 10px; left: 10px;
  width: 200px;
  height: 240px;
  border: 1px solid var(--accent-mid);
  pointer-events: none;
  z-index: -1;
}

/* 3-col stats row — gap shows through as grid lines */
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 36px;
}
.about-stat {
  background: var(--bg);
  padding: 20px 24px;
}
.about-stat-num {
  font-family: var(--serif);
  font-size: 32px;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 4px;
}
.about-stat-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}


/* ─────────────────────────────────────────
   10. EXPERIENCE
───────────────────────────────────────── */
#experience { background: var(--bg2); }

.exp-list { display: flex; flex-direction: column; }

/* Date column left, content right */
.exp-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  cursor: default;
  transition: background 0.2s;
}
.exp-item:first-child { border-top: 1px solid var(--border); }

/* On hover: row lightens and expands edge-to-edge */
.exp-item:hover {
  background: rgba(255,255,255,0.5);
  margin: 0 -48px;
  padding-left: 48px;
  padding-right: 48px;
}

.exp-date {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.03em;
  padding-top: 4px;
  line-height: 1.6;
}

.exp-role {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 2px;
}
.exp-company {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  text-transform: uppercase;
}

/* Custom dash bullets */
.exp-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.exp-bullets li {
  font-size: 13.5px;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
  line-height: 1.6;
}
.exp-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent-mid);
  font-size: 11px;
  top: 2px;
}

/* Skill tags below each role */
.exp-tag {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2px 8px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 10px;
  margin-right: 4px;
}


/* ─────────────────────────────────────────
   11. EDUCATION & SKILLS
───────────────────────────────────────── */
#education { background: var(--bg); }

.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

/* Card with thick left accent */
.edu-card {
  padding: 32px;
  border: 1px solid var(--border);
  background: var(--bg);
  position: relative;
}
.edu-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
}

.edu-school-name {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 4px;
}
.edu-degree-text {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.edu-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

/* Chip / tag used for coursework, skills, certifications */
.chip {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 3px 10px;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
  background: var(--bg);
}

.coursework-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* Skill bars */
.skills-group { margin-bottom: 24px; }
.skills-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}



/* ─────────────────────────────────────────
   12. INTERESTS
   4 cards in a grid. On hover, a blue bar
   slides in from the left along the bottom.
───────────────────────────────────────── */
#interests { background: var(--bg2); }

/* 1px gaps expose --border color as grid lines */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.interest-card {
  background: var(--bg2);
  padding: 48px 28px 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  cursor: default;
  transition: background 0.3s;
  position: relative;
  overflow: hidden;
}

/* Bottom accent bar — slides in on hover */
.interest-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.interest-card:hover { background: var(--bg); }
.interest-card:hover::after { transform: scaleX(1); }
.interest-card:hover .interest-icon-wrap {
  border-color: var(--accent);
  background: var(--accent-lt);
}

/* Circular icon container */
.interest-icon-wrap {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: border-color 0.25s, background 0.25s;
  flex-shrink: 0;
}

.interest-title {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
}


/* Photo variant — full-bleed background image with dark gradient overlay.
   Usage: add class "interest-card--photo" + inline style="background-image:url(...)" */
.interest-card--photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Dark gradient overlay sits behind content */
.interest-card--photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(26,23,20,0.28) 0%, rgba(26,23,20,0.62) 100%);
  z-index: 0;
  transition: background 0.35s ease;
}

/* Keep accent bar above overlay */
.interest-card--photo::after { z-index: 2; }

/* Lift content above overlay */
.interest-card--photo .interest-icon-wrap,
.interest-card--photo .interest-title { position: relative; z-index: 1; }

/* White text + translucent icon ring */
.interest-card--photo .interest-title { color: #fff; }
.interest-card--photo .interest-icon-wrap {
  border-color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.12);
}

/* Make hardcoded-dark SVG icons appear white on the overlay */
.interest-card--photo .interest-icon-wrap img {
  filter: brightness(0) invert(1);
}

/* Hover: lighten overlay, don't replace bg with solid color */
.interest-card--photo:hover { background-color: transparent; }
.interest-card--photo:hover::before {
  background: linear-gradient(to bottom, rgba(26,23,20,0.12) 0%, rgba(26,23,20,0.44) 100%);
}
.interest-card--photo:hover .interest-icon-wrap {
  border-color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.22);
}


/* ─────────────────────────────────────────
   13. CONTACT
   Dark background — colors inverted.
───────────────────────────────────────── */
#contact {
  background: var(--ink);
  padding: 96px 48px;
}
.contact-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 48px;
}
#contact .sec-tag { color: var(--accent-mid); }
#contact .sec-tag::after { background: rgba(255,255,255,0.1); }

.contact-heading {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 56px);
  color: var(--bg);
  line-height: 1.1;
  margin-bottom: 16px;
}
.contact-heading em { font-style: italic; color: var(--accent-mid); }

.contact-sub {
  font-size: 14px;
  color: rgba(253,250,246,0.5);
  margin-bottom: 48px;
  max-width: 400px;
}

.contact-links { display: flex; gap: 16px; flex-wrap: wrap; }

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  transition: all 0.2s;
}
/* Light filled button */
.contact-link-primary {
  background: var(--bg);
  color: var(--ink);
  border: 1.5px solid var(--bg);
}
.contact-link-primary:hover { background: var(--accent-lt); border-color: var(--accent-lt); }

/* Ghost/outline button */
.contact-link-outline {
  background: transparent;
  color: var(--bg);
  border: 1.5px solid rgba(253,250,246,0.2);
}
.contact-link-outline:hover { border-color: var(--bg); }


/* ─────────────────────────────────────────
   14. FOOTER
───────────────────────────────────────── */
footer {
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 20px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
footer span {
  font-size: 11px;
  color: rgba(253,250,246,0.3);
  letter-spacing: 0.04em;
}


/* ─────────────────────────────────────────
   15. KEYFRAME ANIMATIONS
───────────────────────────────────────── */

/* Hero elements fade up on page load */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll indicator appearing */
@keyframes fadeIn {
  to { opacity: 0.6; }
}


/* ─────────────────────────────────────────
   16. RESPONSIVE — MOBILE (≤768px)
   Collapses multi-column layouts to single
   column and tightens padding.
───────────────────────────────────────── */
@media (max-width: 768px) {
  /* ── Nav ── */
  nav { padding: 0 20px; }

  /* Hide desktop links, show hamburger */
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  /* Mobile nav drawer — slides in below nav bar */
  nav.open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: rgba(253, 250, 246, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 8px 20px 20px;
    gap: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  }
  nav.open .nav-links a {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    letter-spacing: 0.06em;
  }
  nav.open .nav-links a:last-child { border-bottom: none; }
  nav.open .nav-resume {
    margin-top: 12px;
    text-align: center;
    padding: 10px 14px !important;
  }

  /* ── Hero ── */
  #hero { padding: 80px 20px 60px; }
  .hero-sub { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero-rule { display: none; }

  /* ── Sections ── */
  .section { padding: 64px 20px; }
  #contact { padding: 64px 20px; }
  .contact-inner { padding: 0; }

  /* ── Footer ── */
  footer {
    padding: 20px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  /* ── About ── */
  .about-grid { grid-template-columns: 1fr; }
  .about-photo-wrap {
    display: flex;
    justify-content: center;
    margin-top: 8px;
  }
  .about-photo-wrap .about-photo { width: 160px; height: 192px; }
  .about-photo-frame { display: none; }
  .about-stats { grid-template-columns: repeat(3, 1fr); }

  /* ── Education ── */
  .edu-grid { grid-template-columns: 1fr; }

  /* ── Interests ── */
  .interests-grid { grid-template-columns: 1fr 1fr; }

  /* ── Experience ── */
  .exp-item { grid-template-columns: 1fr; gap: 8px; }
  .exp-item:hover { margin: 0; padding-left: 0; padding-right: 0; }
}
