/* ================================================================
   Samuel Edwards — Portfolio
   styles.css
   ================================================================ */

/* ----------------------------------------------------------------
   Fonts
   ---------------------------------------------------------------- */
@font-face {
  font-family: 'ApfelGrotezk';
  src: url('ApfelGrotezk-Regular.woff') format('woff');
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

/* ----------------------------------------------------------------
   Design Tokens
   ---------------------------------------------------------------- */
:root {
  --font-sans: 'ApfelGrotezk', sans-serif;

  --color-white:    #ffffff;
  --color-white-90: rgba(255, 255, 255, 0.90);
  --color-white-75: rgba(255, 255, 255, 0.75);
  --color-violet:   #a48bef;
  --color-coral:    #ff6b5b;

  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  --z-bg:      0;
  --z-overlay: 10;
  --z-content: 20;
  --z-nav-mob: 90;
  --z-header:  100;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 220ms;
}

/* ----------------------------------------------------------------
   Reset
   ---------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}


body {
  background: #090511;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.nav-active {
  overflow: hidden;
}

/* ----------------------------------------------------------------
   Screen-reader only
   ---------------------------------------------------------------- */
.sr-only {
  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
   ---------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  z-index: 200;
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-violet);
  color: var(--color-white);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: top var(--dur) var(--ease-out);
}

.skip-link:focus {
  top: 0;
}

/* ----------------------------------------------------------------
   Site Header
   ---------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-8);
}

/* Monogram logo */
.header-logo {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--color-white);
  text-decoration: none;
  opacity: 0.92;
  position: relative;
  z-index: var(--z-header);
  transition: opacity var(--dur) var(--ease-out);
}

.header-logo:hover {
  opacity: 1;
}

.header-logo:focus-visible {
  opacity: 1;
  outline: 2px solid var(--color-violet);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Desktop nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.header-nav a {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  position: relative;
  padding-bottom: 3px;
  transition: color var(--dur) var(--ease-out);
}

/* Underline that slides in from the left on hover */
.header-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background: var(--color-white);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.32s var(--ease-out);
}

.header-nav a:hover {
  color: var(--color-white);
}

.header-nav a:hover::after,
.header-nav a:focus-visible::after {
  transform: scaleX(1);
}

.header-nav a:focus-visible {
  color: var(--color-white);
  outline: 2px solid var(--color-violet);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: var(--z-header);
}

.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--color-white);
  border-radius: 2px;
  transition:
    opacity  var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--color-violet);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Animated X when open */
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ----------------------------------------------------------------
   Hero — Outer
   ---------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  text-align: center;
  background: #090511;
}

/* ----------------------------------------------------------------
   Hero — Background image
   scale(1.06) gives ~43px headroom each side on a 1440px screen,
   enough for the ambient drift (±5px) + mouse parallax (±10px).
   ---------------------------------------------------------------- */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: var(--z-bg);
  overflow: hidden;
}

.hero-bg-image {
  position: absolute;
  inset: -40px;
  background: url('Website%20hero1.jpg') 50% 50% / cover no-repeat;
  will-change: transform;
}

@media (max-width: 768px) {
  .hero-bg-image {
    background-image: url('hero-mobile.jpg');
  }
}

/* ----------------------------------------------------------------
   Hero — Overlay
   Radial gradient: very subtle dark centre for text contrast,
   edges stay open so the image remains bright and luminous.
   ---------------------------------------------------------------- */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: var(--z-overlay);
  background: radial-gradient(
    ellipse 80% 70% at 50% 48%,
    rgba(8, 4, 18, 0.02) 0%,
    rgba(8, 4, 18, 0.07) 100%
  );
}

/* ----------------------------------------------------------------
   Hero — Content
   ---------------------------------------------------------------- */
.hero-content {
  position: relative;
  z-index: var(--z-content);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 5.5rem var(--sp-6) 3rem;
}

/* ----------------------------------------------------------------
   Hero — Name
   ---------------------------------------------------------------- */
.hero-name {
  font-family: var(--font-sans);
  font-size: clamp(3.5rem, 11vw, 10rem);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.02em;
  color: var(--color-white);
  margin-bottom: clamp(0.8rem, 1.8vw, 1.4rem);
}

/* ----------------------------------------------------------------
   Hero — Subtitle
   ---------------------------------------------------------------- */
.hero-subtitle {
  font-family: var(--font-sans);
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--color-white-90);
  max-width: 48ch;
  margin: 0 auto var(--sp-10);
  text-align: center;
}

/* ----------------------------------------------------------------
   Hero — CTA Buttons
   ---------------------------------------------------------------- */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1.85rem;
  font-family: var(--font-sans);
  font-size: 0.77rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 100px;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    background var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out),
    transform 120ms var(--ease-out);
}

.btn:focus-visible {
  outline: 2px solid var(--color-violet);
  outline-offset: 3px;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

/* Primary — frosted glass */
.btn-primary {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--color-white);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus-visible {
  background: #ffffff;
  border-color: #ffffff;
  color: #0d0d0d;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Secondary — outline */
.btn-secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.34);
  color: var(--color-white-90);
}

.btn-secondary:hover,
.btn-secondary:active,
.btn-secondary:focus-visible {
  background: #ffffff;
  border-color: #ffffff;
  color: #0d0d0d;
}

/* ----------------------------------------------------------------
   Entrance Animation
   Elements stagger in on load; all motion disabled for users
   who prefer reduced motion.
   ---------------------------------------------------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fade-in-up       { animation: fadeInUp 1s var(--ease-out) both; }
.fade-in-up-delay { animation: fadeInUp 1s var(--ease-out) 0.5s both; }
.fade-in          { animation: fadeIn 0.8s var(--ease-out) both; }
.fade-in-static   { animation: fadeIn 0.8s var(--ease-out) both; }
.fade-in-delay    { animation: fadeIn 0.8s var(--ease-out) 0.2s both; }
.fade-in-delay-2  { animation: fadeIn 0.8s var(--ease-out) 0.4s both; }
.fade-in-delay-3  { animation: fadeIn 0.8s var(--ease-out) 0.6s both; }

/* Hero stagger — delay overrides per element */
.hero-line-1   { animation-delay: 0.05s; margin-bottom: 0; }
.hero-line-2   { animation-delay: 0.18s; }
.hero-subtitle { animation-delay: 0.32s; }


/* ----------------------------------------------------------------
   Responsive — Large tablet
   ---------------------------------------------------------------- */
@media (max-width: 1024px) {
  .site-header {
    padding: var(--sp-5) var(--sp-6);
  }

  .header-nav {
    gap: var(--sp-6);
  }
}

/* ----------------------------------------------------------------
   Responsive — Tablet
   ---------------------------------------------------------------- */
@media (max-width: 899px) {
  .hero-content {
    padding-left: var(--sp-6);
    padding-right: var(--sp-6);
  }
}

/* ----------------------------------------------------------------
   Responsive — Mobile (hamburger nav)
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
  .site-header {
    padding: var(--sp-4) var(--sp-5);
  }

  .nav-toggle {
    display: flex;
  }

  /* Full-screen frosted overlay nav */
  .header-nav {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.2rem;
    background: rgba(10, 5, 20, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: var(--z-nav-mob);
  }

  .header-nav.nav-open {
    display: flex;
  }

  .header-nav a {
    font-size: 1rem;
    letter-spacing: 0.15em;
    color: var(--color-white-90);
  }

  .hero-content {
    padding-left: var(--sp-5);
    padding-right: var(--sp-5);
  }
}

/* ----------------------------------------------------------------
   Responsive — Small mobile
   ---------------------------------------------------------------- */
@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 240px;
  }
}

/* ================================================================
   About Section
   ================================================================ */
.about {
  background: #ffffff;
  padding: 7rem 0 8rem;
}

.about-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-16);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.about-heading {
  font-family: var(--font-sans);
  font-size: clamp(2.8rem, 5vw, 5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: #0d0d0d;
  margin-bottom: var(--sp-8);
}

.about-body {
  font-family: var(--font-sans);
  font-size: clamp(0.95rem, 1vw, 1.05rem);
  font-weight: 400;
  line-height: 1.85;
  color: #2a2a2a;
  max-width: 52ch;
}

/* Image column */
.about-image-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.about-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
  /* Wipes up into view when scrolled to, then a slow zoom on hover. */
  clip-path: inset(100% 0 0 0);
  transition:
    clip-path 0.9s var(--ease-out),
    transform 0.7s var(--ease-out);
}

.about-image-wrap.revealed .about-image {
  clip-path: inset(0 0 0 0);
}

.about-image-wrap:hover .about-image {
  transform: scale(1.05);
}

.about-image-placeholder {
  display: none;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #f0f0f0;
  border-radius: 2px;
  align-items: center;
  justify-content: center;
}

.about-image-placeholder span {
  font-family: var(--font-sans);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(0, 0, 0, 0.12);
  user-select: none;
  -webkit-user-select: none;
}

/* ----------------------------------------------------------------
   Scroll reveal
   ---------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay {
  transition-delay: 0.15s;
}


/* ----------------------------------------------------------------
   About — Responsive tablet
   ---------------------------------------------------------------- */
@media (max-width: 899px) {
  .about {
    padding: 5rem 0 6rem;
  }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 0 var(--sp-8);
  }

  .about-image-wrap {
    max-width: 420px;
  }
}

/* ----------------------------------------------------------------
   About — Responsive mobile
   ---------------------------------------------------------------- */
@media (max-width: 480px) {
  .about {
    padding: 4rem 0 5rem;
  }

  .about-inner {
    padding: 0 var(--sp-5);
    gap: 2.5rem;
  }
}


/* ================================================================
   Image Divider
   ================================================================ */
.img-divider {
  position: relative;
  height: 280px;
  overflow: hidden;
}

.img-divider-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 125%;
  object-fit: cover;
  object-position: center center;
  display: block;
  will-change: transform;
}

@media (max-width: 768px) {
  .img-divider {
    height: 190px;
  }
}

/* ================================================================
   Education Section
   ================================================================ */
.education {
  background: #ffffff;
  padding: 7rem 0 8rem;
}

.education-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-16);
}

.education-heading {
  font-family: var(--font-sans);
  font-size: clamp(2.8rem, 5vw, 5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: #0d0d0d;
  margin-bottom: 4rem;
}

/* Education list */
.edu-list {
  margin-bottom: 4rem;
}

.edu-entry {
  border-top: 1px solid rgba(0, 0, 0, 0.14);
  padding: 2rem 0;
}

.edu-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 1rem;
}

.edu-entry-left {
  flex: 1;
}

.edu-entry-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
  padding-top: 0.1rem;
}

.edu-entry-institution {
  font-family: var(--font-sans);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: #0d0d0d;
  margin-bottom: 0.35rem;
}

.edu-entry-degree {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.5);
}

.edu-entry-desc {
  font-family: var(--font-sans);
  font-size: clamp(0.9rem, 1vw, 1rem);
  line-height: 1.8;
  color: #2a2a2a;
  max-width: 72ch;
}

.edu-years {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(0, 0, 0, 0.4);
  text-transform: uppercase;
}

.edu-badge {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-violet);
  background: rgba(164, 139, 239, 0.1);
  padding: 0.22em 0.65em;
  border-radius: 100px;
}

.edu-tag {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  font-style: italic;
  color: rgba(0, 0, 0, 0.38);
}

/* Academic highlights */
.edu-highlights {
  border-top: 1px solid rgba(0, 0, 0, 0.14);
  padding-top: 2.5rem;
}

.edu-highlights-heading {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.55);
  margin-bottom: 1.25rem;
}

.edu-highlights-list {
  list-style: none;
  max-width: 820px;
}

.edu-highlight-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.edu-highlight-type {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.35);
}

.edu-highlight-title {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.4;
}

.edu-highlight-score {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-violet);
  white-space: nowrap;
}

/* ----------------------------------------------------------------
   Education — Responsive tablet
   ---------------------------------------------------------------- */
@media (max-width: 899px) {
  .education {
    padding: 5rem 0 6rem;
  }

  .education-inner {
    padding: 0 var(--sp-8);
  }

  .education-heading {
    margin-bottom: 3rem;
  }

  .edu-highlight-item {
    grid-template-columns: 90px 1fr auto;
    gap: 1rem;
  }
}

/* ----------------------------------------------------------------
   Education — Responsive mobile
   ---------------------------------------------------------------- */
@media (max-width: 480px) {
  .education {
    padding: 4rem 0 5rem;
  }

  .education-inner {
    padding: 0 var(--sp-5);
  }

  .edu-highlight-item {
    grid-template-columns: 1fr auto;
    gap: 1rem;
  }

  .edu-highlight-type {
    display: none;
  }
}


/* ================================================================
   Contact Section
   ================================================================ */
.contact {
  background: white url('DividerD.jpg') top center / cover no-repeat;
  padding: clamp(4rem, 10vw, 7rem) 0 clamp(2rem, 5vw, 4rem);
  text-align: center;
  width: 100%;
  overflow: hidden;
}

.contact-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--sp-8);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-heading {
  font-family: var(--font-sans);
  font-size: clamp(2.8rem, 5vw, 5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: #0d0d0d;
  margin-bottom: var(--sp-6);
}

.contact-body {
  font-size: clamp(0.95rem, 1vw, 1.05rem);
  line-height: 1.7;
  color: #1a1a1a;
  max-width: 44ch;
  margin-bottom: var(--sp-10);
}

.contact-links {
  list-style: none;
  width: 100%;
  border-top: 1px solid rgba(0, 0, 0, 0.14);
}

.contact-link {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5) 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: transparent;
  transition: color var(--dur) var(--ease-out);
}

.contact-link::after {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  margin-left: auto;
  flex-shrink: 0;
  background: url('icon-right-arrow.svg') center / contain no-repeat;
  transition: transform 0.3s var(--ease-out);
}

.contact-link:hover,
.contact-link:focus-visible {
  color: #000000;
}

.contact-link:hover::after {
  transform: translateX(5px);
}

.contact-link:focus-visible {
  outline: 2px solid var(--color-violet);
  outline-offset: 3px;
}

.contact-link svg {
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity var(--dur) var(--ease-out);
}

.contact-link:hover svg {
  opacity: 0.9;
}

/* ----------------------------------------------------------------
   Contact — Responsive
   ---------------------------------------------------------------- */
@media (max-width: 480px) {
  .contact {
    padding: 4rem 0 5rem;
  }

  .contact-inner {
    padding: 0 var(--sp-5);
  }

  .contact-link {
    padding: var(--sp-4) 0;
  }
}
