/* =========================================================
   THE UNBOXED SCHOOL: shared styles
   Palette: white / green / dark green
   ========================================================= */
/* fonts are stored with the site (fonts/, licence in fonts/LICENSE.txt), so text looks the same in
   every browser from the first frame, with no wait on an outside font server */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/fraunces-latin-opsz-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/fraunces-latin-ext-opsz-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/fraunces-latin-opsz-italic.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/fraunces-latin-ext-opsz-italic.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("../fonts/figtree-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("../fonts/figtree-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/caveat-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/caveat-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --white: #FFFFFF;
  --green: #4CA154;
  --green-dark: #26532F;
  --green-deep: #1A3D22;
  --cream: #F6F0E1;
  --ink: #23261F;
  --soft: rgba(255, 255, 255, 0.74);
  --bar: #13321B;    /* top bar once scrolled */
  --pill: #20472A;   /* nav pill and phone menu button */
  --line: rgba(255, 255, 255, 0.14);

  --f-display: "Fraunces", Georgia, serif;
  /* "The Unboxed School" name: change this one line to restyle it everywhere */
  --f-wordmark: "Fraunces", Georgia, serif;
  --f-body: "Figtree", system-ui, sans-serif;
  --f-hand: "Caveat", cursive;

  /* wallpaper tile: faint tyres, containers, swings, seesaws */
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%23224C2C' stroke-width='3'%3E%3Ccircle cx='40' cy='44' r='15'/%3E%3Ccircle cx='40' cy='44' r='6'/%3E%3Ccircle cx='150' cy='150' r='12'/%3E%3Ccircle cx='150' cy='150' r='4.5'/%3E%3Crect x='112' y='30' width='56' height='26' rx='2'/%3E%3Cpath d='M124 34v18M136 34v18M148 34v18M160 34v18' stroke-width='2'/%3E%3Crect x='20' y='130' width='48' height='22' rx='2' transform='rotate(-8 44 141)'/%3E%3C/g%3E%3Cg fill='%23224C2C'%3E%3Ccircle cx='96' cy='104' r='3'/%3E%3Ccircle cx='180' cy='96' r='2.5'/%3E%3Ccircle cx='86' cy='182' r='2.5'/%3E%3C/g%3E%3C/svg%3E");

  --nav-h: 88px;
  --max: 1200px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

/* phones in landscape: keep text at its designed size (iOS and Android otherwise enlarge it) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

html.scroll-locked { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--green-deep);
  color: var(--white);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;   /* Firefox on Mac: the same smoothing as Chrome and Safari */
  overflow-x: hidden;   /* older browsers */
  overflow-x: clip;     /* same, without making the page a scroll box (keeps the home intro's sticky working) */
}

.pattern-bg {
  background-color: var(--green-deep);
  background-image: var(--pattern);
  background-size: 200px 200px;
}

main { flex: 1; position: relative; overflow-x: clip; }
a { color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: var(--green); color: #fff; }
.wordmark { font-family: var(--f-wordmark); }

/* =========================================================
   TOP BAR
   ========================================================= */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 52px);
  transition: background .5s ease, box-shadow .5s ease, transform .7s var(--ease-out);
}
/* Solid colours only, no see-through blur (backdrop-filter): a blur is redrawn every frame from whatever
   moves behind it. On desktop the bar keeps one permanent GPU layer, so sliding it away and back never
   creates and destroys a layer mid-scroll (that made it blink). Not on phones: there the layer would
   trap the full-screen menu inside the bar */
@media (min-width: 901px) { .topbar { will-change: transform; } }
.topbar.scrolled { background: var(--bar); box-shadow: 0 1px 0 var(--line); }
.topbar.hidden { transform: translateY(-100%); }

.brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg, .brand img { height: 42px; width: auto; }
.brand-name {
  font-family: var(--f-wordmark);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.nav { display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: var(--pill); border: 1px solid var(--line); }
.nav a {
  font-family: var(--f-body);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 999px;
  color: var(--soft);
  transition: color .25s ease, background .25s ease;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav a.active { color: #fff; background: var(--green); box-shadow: 0 0 22px rgba(76,161,84,.45); }

.menu-btn { display: none; }

/* phones and small tablets: the six links move into a full-screen menu */
@media (max-width: 900px) {
  .menu-btn {
    position: relative; z-index: 2;
    display: inline-flex; align-items: center; gap: 12px;
    padding: 11px 18px 11px 20px; border-radius: 999px; cursor: pointer;
    background: var(--pill); border: 1px solid var(--line); color: #fff;
    font: 500 15px/1 var(--f-body);
  }
  .menu-btn i { position: relative; width: 18px; height: 10px; }
  .menu-btn i::before, .menu-btn i::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px;
    background: currentColor; transition: transform .4s var(--ease-out), top .4s var(--ease-out); }
  .menu-btn i::before { top: 0; }
  .menu-btn i::after { top: 8px; }
  .menu-open .menu-btn { background: var(--green); border-color: transparent; }
  .menu-open .menu-btn i::before { top: 4px; transform: rotate(45deg); }
  .menu-open .menu-btn i::after { top: 4px; transform: rotate(-45deg); }

  .nav {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px;
    padding: var(--nav-h) clamp(24px, 8vw, 64px) 40px; border: 0; border-radius: 0;
    background: var(--green-deep) var(--pattern) 0 0 / 200px 200px;
    visibility: hidden; opacity: 0; transition: opacity .4s ease, visibility .4s;
  }
  .menu-open .nav { visibility: visible; opacity: 1; }
  .nav a { font-family: var(--f-display); font-size: clamp(38px, 11vw, 56px); font-weight: 400; letter-spacing: -0.02em;
    line-height: 1.1; padding: 4px 0; color: #fff; background: none !important; box-shadow: none !important; }
  .nav a.active { color: var(--green); }
  /* the open menu covers the screen, so the bar drops its background and slide while it's open */
  .menu-open .topbar { transform: none; background: transparent; box-shadow: none; }
}

/* =========================================================
   PAGE TRANSITION CURTAIN
   ========================================================= */
.curtain {
  position: fixed; inset: 0; z-index: 200;
  pointer-events: none;
  display: grid; place-items: center;
  background: var(--green-dark);
}
.curtain svg { width: 150px; height: auto; opacity: .9; }
.logo-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* =========================================================
   FLOATING MODELS (built by js/main.js from THE SCENE)
   ========================================================= */
[data-scene] { position: relative; }   /* any element that hosts the scene */
.float-layers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; contain: strict; }
/* each depth layer slides on its own GPU layer (scroll drift, mouse parallax); GSAP gives the
   bobbing models their own layers while they move, so they need no will-change here */
.float-layer { position: absolute; inset: 0; will-change: transform; }
/* home zoom: the depth layers are scaled up many times over. Scaled GPU layers get re-drawn by the
   browser in jumps (shimmer/flicker), so here the whole un-scaled wrapper is the one GPU layer and
   the models are drawn into it, sharp at every size */
.float-layers.flat { will-change: transform; }
.float-layers.flat .float-layer { will-change: auto; }
.floater { position: absolute; }
.floater svg { width: 100%; height: auto; display: block; overflow: visible; }

/* =========================================================
   GENERIC PAGE HEAD
   ========================================================= */
.page-head {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: calc(var(--nav-h) + clamp(48px, 9vw, 110px)) 16px 40px;
}
.page-head h1, .display {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(46px, 8vw, 104px);
  line-height: .98;
  letter-spacing: -0.03em;
  margin: 0;
}
/* the green italic word in every heading and wordmark */
h1 em, h2 em, h3 em, .wordmark em { font-style: italic; color: var(--green); }
.page-head p { max-width: 560px; margin: 22px auto 0; color: var(--soft); font-size: 19px; }

/* split-text helper (js/main.js): words stay unbroken, letters can move on their own */
.word { display: inline-block; white-space: nowrap; }
.char { display: inline-block; }

/* =========================================================
   PILL BUTTON
   ========================================================= */
.pill {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 7px 28px 7px 7px;
  border-radius: 999px;
  background: var(--green-dark);
  color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.1);
  font-family: var(--f-body); font-size: 18px; font-weight: 500;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 30px rgba(0,0,0,.35);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}
.pill .pill-icon {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--green); display: grid; place-items: center;
  box-shadow: 0 0 22px rgba(76,161,84,.5);
  transition: transform .3s var(--ease-out);
}
.pill:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 16px 36px rgba(0,0,0,.45); }
.pill:hover .pill-icon { transform: translateX(4px); }

/* reveal-on-scroll default state (only when JS is running) */
.js [data-reveal] { opacity: 0; transform: translateY(32px); }

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  position: relative;
  z-index: 3;
  background: var(--green-dark);
  border-radius: 40px 40px 0 0;
  margin-top: 120px;
  padding: 64px clamp(16px, 5vw, 64px) 28px;
  color: var(--soft);
  font-size: 15px;
  overflow: hidden;
}
.footer-top {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px;
}
.footer h3 {
  font-family: var(--f-wordmark); font-weight: 400; color: #fff;
  font-size: clamp(32px, 4vw, 48px); line-height: 1.05; margin: 0 0 14px; letter-spacing: -0.02em;
}
.footer-top > div:first-child { align-self: center; }
.footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; align-content: start; }
.footer-links a { text-decoration: none; color: #fff; font-size: 17px; }
.footer-links a:hover { color: var(--green); }
.footer-contact { grid-column: 1 / -1; margin-top: 10px; }
.footer-contact a { color: var(--green); }
.footer-word {
  max-width: var(--max); margin: 48px auto 0;
  font-family: var(--f-wordmark); font-size: clamp(44px, 10.5vw, 150px); line-height: .9;
  letter-spacing: -0.04em; color: rgba(255,255,255,.07); white-space: nowrap; text-align: center;
  -webkit-user-select: none; user-select: none;
}
.footer-copy {
  max-width: var(--max); margin: 24px auto 0; padding-top: 20px;
  border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.55;
  display: flex; flex-wrap: wrap; gap: 8px 30px; justify-content: space-between;
}
@media (max-width: 760px) {
  :root { --nav-h: 72px; }
  .brand svg, .brand img { height: 32px; }
  .brand-name { display: none; }
  .footer { border-radius: 28px 28px 0 0; padding-top: 48px; }
  .footer-top { grid-template-columns: 1fr; }
}

/* =========================================================
   PAPER (About letter, Contact form, Media clippings)
   ========================================================= */
.paper {
  position: relative;
  color: var(--ink); background-color: var(--cream);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.38  0 0 0 0 0.25  0 0 0 0.10 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(ellipse at center, transparent 55%, rgba(150,120,70,.16) 100%),
    linear-gradient(175deg, #FBF6EA 0%, #F2E9D3 100%);
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,.12), 0 8px 14px rgba(0,0,0,.18), 0 26px 44px rgba(0,0,0,.30), 0 60px 100px rgba(0,0,0,.38);
}
/* a second sheet peeking out underneath */
.paper.stacked::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 4px; background: #E9DEC3;
  transform: rotate(2deg) translate(8px, 10px); box-shadow: 0 20px 44px rgba(0,0,0,.35); }
/* green tape: size and angle can be tuned per use with --tape-w / --tape-h / --tape-r / --tape-top */
.taped::after { content: ""; position: absolute; z-index: 2; left: 50%;
  top: var(--tape-top, -16px); width: var(--tape-w, 130px); height: var(--tape-h, 34px);
  transform: translateX(-50%) rotate(var(--tape-r, -2deg));
  background: rgba(76,161,84,.55); box-shadow: 0 2px 4px rgba(0,0,0,.15); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
