/* ==========================================================================
   Carl Orrall — homepage styles
   Sections below follow the order they appear on the page.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Design tokens
   Change a colour or font here and it updates everywhere it's used,
   e.g. `color: var(--accent)`.
   -------------------------------------------------------------------------- */
:root {
  /* Colours */
  --bg: #F1EEE6;       /* page background (warm off-white) */
  --ink: #14130F;      /* main text colour (near-black) */
  --muted: #5E5B52;    /* secondary text */
  --line: #14130F;     /* divider lines */
  --accent: #68bef3;   /* orange highlight is #FF5A2C*/
  --tile: #D9D4C6;     /* project tile background */
  --hatch: #E6E2D7;    /* stripes in the placeholder boxes */

  /* Spacing: clamp(min, preferred, max) grows with the screen width */
  --pad: clamp(20px, 4.5vw, 64px);

  /* Fonts (loaded from Google Fonts in index.html) */
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}


/* --------------------------------------------------------------------------
   2. Base styles: apply to the whole page
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box; /* padding & borders count inside an element's width */
}

html {
  scroll-behavior: smooth; /* smooth scrolling when clicking nav links */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: .7;
}

/* Visible outline when navigating with the keyboard (Tab key) */
a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* Reusable helper: small uppercase monospace text. Add class="mono" to anything. */
.mono {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
}


/* --------------------------------------------------------------------------
   3. Header / navigation
   -------------------------------------------------------------------------- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--pad);
  position: sticky; /* stays at the top while you scroll */
  top: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.logo {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -.02em;
}

.logo span {
  color: var(--accent);
}

nav {
  display: flex;
  gap: 40px;
}

.pill {
  background: var(--ink);
  color: var(--bg);
  padding: 14px 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Small screens (phones / narrow windows) */
@media (max-width: 820px) {
  nav {
    display: none;
  }
  header {
    padding-block: 14px;
  }
}


/* --------------------------------------------------------------------------
   4. Hero (the big intro at the top)
   -------------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr)); /* 12-column grid */
  column-gap: 24px;
  padding: 48px var(--pad) 0;
  min-height: min(780px, calc(100vh - 80px));
}

.hero-l {
  grid-column: 1 / span 8; /* left side: columns 1–8 */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}

.status {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Pulsing blue "open for work" dot */
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  50% { opacity: .35; }
}

h1 {
  margin: 0;
  font-size: clamp(84px, 14vw, 200px);
  line-height: .86;
  font-weight: 800;
  letter-spacing: -.05em;
}

.lede {
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -.02em;
  max-width: 640px;
  margin: 0 0 12px;
}

.meta {
  color: var(--muted);
  padding-bottom: 100px;
}

.hero-r {
  grid-column: 9 / span 4; /* right side: columns 9–12 */
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 48px;
}

/* Portrait box, with a striped placeholder background */
.photo {
  flex-grow: 1;
  min-height: 320px;
  border: 1.5px solid var(--ink);
  border-radius: 24px;
  background: repeating-linear-gradient(135deg, var(--hatch), var(--hatch) 14px, var(--bg) 14px, var(--bg) 28px);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  overflow: hidden;
  position: relative;
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Small label shown on top of images / placeholders */
.tag {
  background: var(--bg);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  position: relative;
}

.scroll-hint {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

@media (max-width: 820px) {
  .hero {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-height: 0;
    padding-bottom: 40px;
  }
  .hero-r {
    padding-bottom: 0;
  }
  .photo {
    min-height: 320px;
  }
  .scroll-hint {
    display: none;
  }
}


/* --------------------------------------------------------------------------
   5. Marquee (the scrolling blue skills strip)
   -------------------------------------------------------------------------- */
.marquee {
  background: var(--accent);
  overflow: hidden;
  white-space: nowrap;
  height: 72px;
  display: flex;
  align-items: center;
}

.track {
  display: flex;
  gap: 48px;
  padding-right: 48px;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -.02em;
  animation: slide 30s linear infinite; /* lower 30s = faster scrolling */
  flex-shrink: 0;
}

@keyframes slide {
  to { transform: translateX(-100%); }
}

@media (max-width: 820px) {
  .marquee {
    height: 56px;
  }
  .track {
    font-size: 22px;
    gap: 28px;
    padding-right: 28px;
  }
}


/* --------------------------------------------------------------------------
   6. Shared section layout
   -------------------------------------------------------------------------- */
section {
  padding: clamp(72px, 9vw, 128px) var(--pad);
}

.grid12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 24px;
}

.label {
  grid-column: 1 / span 3; /* small label on the left */
}

.body {
  grid-column: 4 / span 9; /* main content on the right */
}

@media (max-width: 820px) {
  .label,
  .body {
    grid-column: 1 / -1; /* full width on small screens */
  }
}

h2 {
  margin: 0;
  font-size: clamp(64px, 8.4vw, 120px);
  line-height: .9;
  font-weight: 800;
  letter-spacing: -.045em;
}


/* --------------------------------------------------------------------------
   7. About
   -------------------------------------------------------------------------- */
.big {
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -.03em;
  margin: 0 0 56px;
}

.cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.col {
  border-top: 1.5px solid var(--line);
  padding-top: 16px;
}

.col h3 {
  margin: 0 0 12px;
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

.col p {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

@media (max-width: 820px) {
  .cols {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .big {
    margin-bottom: 32px;
  }
}


/* --------------------------------------------------------------------------
   8. Work / projects
   -------------------------------------------------------------------------- */
#work {
  padding-top: 0;
  scroll-margin-top: 120px; /* stop below the sticky header when jumping here */
}

.work-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 56px;
  gap: 24px;
}

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* two projects per row */
  gap: 56px 24px;
}

.project {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.thumb {
  aspect-ratio: 3 / 2;
  border-radius: 20px;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  overflow: hidden;
  position: relative;
  transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}

.project:hover .thumb {
  transform: translateY(-6px); /* lift the image on hover */
}

.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Four thumbnail colour styles: t1 dark, t2 orange, t3 beige, t4 striped */
.t1 {
  background: var(--accent);
  color: var(--bg);
}

.t2 {
  background: var(--hatch);
}

.t3 {
  background: var(--tile);
}

.t4 {
  border: 1.5px solid var(--ink);
  background: repeating-linear-gradient(135deg, var(--hatch), var(--hatch) 14px, var(--bg) 14px, var(--bg) 28px);
}

.thumb .tag {
  background: transparent;
  border: 1px solid currentColor;
}

.t4 .tag {
  background: var(--bg);
  border: 0;
}

.ptitle {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.ptitle h3 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 600;
  letter-spacing: -.02em;
}

.stack {
  font-size: 12px;
  color: var(--muted);
}

.links {
  display: flex;
  gap: 16px;
  font-size: 12px;
}

.links a {
  border-bottom: 1.5px solid var(--ink);
}

@media (max-width: 820px) {
  .projects {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .work-head {
    margin-bottom: 32px;
  }
}


/* --------------------------------------------------------------------------
   9. Path (education & experience timeline)
   -------------------------------------------------------------------------- */
#path {
  padding-top: 0;
  scroll-margin-top: 120px; /* stop below the sticky header when jumping here */
}

.row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 200px; /* year | title | place */
  gap: 24px;
  padding: 28px 0;
  border-top: 1.5px solid var(--line);
  align-items: baseline;
}

.row:last-child {
  border-bottom: 1.5px solid var(--line);
}

.row h3 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 600;
  letter-spacing: -.02em;
}

.row .who {
  font-size: 18px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 20px 0;
  }
}


/* --------------------------------------------------------------------------
   10. Contact & footer
   -------------------------------------------------------------------------- */
#contact {
  background: var(--ink);
  color: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 48px;
  min-height: 70vh;
  justify-content: space-between;
}

#contact h2 {
  margin-top: 32px;
  font-size: clamp(52px, 12.2vw, 176px);
  line-height: .88;
}

#contact h2 span {
  color: var(--accent);
}

#contact a:focus-visible {
  outline-color: var(--bg);
}

.cta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 48px;
}

.cta .main {
  background: var(--accent);
  color: var(--ink);
  padding: 20px 32px;
  border-radius: 999px;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 600;
  min-height: 44px;
}

.cta .ghost {
  border: 1.5px solid var(--bg);
  padding: 18px 28px;
  border-radius: 999px;
  font-size: 20px;
  min-height: 44px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: #B9B5A8;
  font-size: 12px;
}


/* --------------------------------------------------------------------------
   11. Scroll-reveal animation
   Elements with class="rv" start hidden; js/main.js adds "in" to fade them in.
   -------------------------------------------------------------------------- */
.rv {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
}

.rv.in {
  opacity: 1;
  transform: none;
}

/* Respect visitors who turned off animations in their OS settings */
@media (prefers-reduced-motion: reduce) {
  .track,
  .dot {
    animation: none;
  }
  .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}
