/* =========================================================
   AMELIA GATES — v3
   ========================================================= */

:root {
  --bg:    #ffffff;
  --ink:   #0b0b0b;
  --grey:  #8c8c8c;
  --hair:  #dcdcdc;

  --serif: "Times New Roman", Times, serif;
  --sans:  "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;

  --content:  min(880px, 90vw);
  --gutter:   clamp(26px, 6vw, 104px);

  --header-h: 150px;              /* measured by JS on load + resize */
  --footer-h: 46px;
  --veil-top: clamp(36px, 6vh, 84px);
  --veil-bot: clamp(24px, 4vh, 50px);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* =========================================================
   FIXED MASTHEAD
   ========================================================= */

.masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--bg);
  text-align: center;
  padding: clamp(20px, 4.2vh, 46px) 0 clamp(16px, 3vh, 34px);
}

.brand {
  display: inline-block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.wordmark {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: min(clamp(1.8rem, 7vw, 5.4rem), 11svh);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding-left: 0.2em;      /* optical: offsets the trailing letter-space */
  white-space: nowrap;
}

.rule {
  display: block;
  width: 100%;
  height: 1px;
  margin-top: clamp(10px, 1.6vh, 18px);
  background: var(--hair);
}

/* =========================================================
   DISSOLVE BANDS
   content fades as it slides under the masthead / footer
   ========================================================= */

.veil {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 20;
  pointer-events: none;
}

.veil--top {
  top: var(--header-h);
  height: var(--veil-top);
  background: linear-gradient(to bottom, #fff 0%, rgba(255,255,255,0) 100%);
}

.veil--bottom {
  bottom: var(--footer-h);
  height: var(--veil-bot);
  background: linear-gradient(to top, #fff 0%, rgba(255,255,255,0) 100%);
}

/* =========================================================
   PANELS
   ========================================================= */

.scroller {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100svh;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scroller::-webkit-scrollbar { width: 0; height: 0; display: none; }

.panel {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top:    calc(var(--header-h) + var(--veil-top));
  padding-bottom: calc(var(--footer-h) + var(--veil-bot));
}

/* ---------- panel 1 ---------- */

.hero {
  flex: 1 1 auto;
  min-height: 0;
  width: var(--content);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ---------- shared body type ---------- */

.caption,
.statement p {
  font-family: var(--sans);
  font-size: clamp(0.78rem, 1.22vw, 0.98rem);
  font-weight: 300;
}

.caption {
  flex: 0 0 auto;
  margin: clamp(16px, 3vh, 34px) 0 0;
  max-width: var(--content);
  padding: 0 20px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  line-height: 1.7;
}

/* the caption may only break between "...MIND" and "AND KNOW-IT-ALL" */
.caption span { white-space: nowrap; }

/* ---------- arrows ---------- */

.arrow {
  flex: 0 0 auto;
  margin: clamp(14px, 2.6vh, 30px) 0 0;
  padding: 10px 16px;
  border: 0;
  background: none;
  color: var(--grey);
  cursor: pointer;
  line-height: 0;
  animation: beat 2.8s ease-in-out infinite;
}

.arrow svg {
  width: clamp(24px, 2.4vw, 32px);
  height: auto;
  overflow: visible;
}

.arrow polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.arrow:focus-visible { outline: 1px solid var(--hair); outline-offset: 2px; }

.arrow--up {
  margin: 0 0 clamp(14px, 2.4vh, 30px);
  animation-name: beat-up;
}

@keyframes beat {
  0%, 100% { opacity: 0.22; transform: translateY(0); }
  50%      { opacity: 0.72; transform: translateY(3px); }
}
@keyframes beat-up {
  0%, 100% { opacity: 0.22; transform: translateY(0); }
  50%      { opacity: 0.72; transform: translateY(-3px); }
}

/* ---------- panel 2 ---------- */

.split {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  padding: 0 var(--gutter);
  display: grid;
  /* the right column never grows tall enough to overflow the panel */
  grid-template-columns: 1fr min(56%, 70svh);
  align-items: center;
  gap: clamp(28px, 4vw, 70px);
}

.portrait {
  grid-column: 2;
  margin: 0;
  min-width: 0;
  line-height: 0;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
}

.statement {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.statement p {
  margin: 0;
  max-width: 54ch;
  line-height: 2;
  letter-spacing: 0.1em;
}

.statement p + p { margin-top: 1.2em; }

.tel { white-space: nowrap; }

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: var(--footer-h);
  padding: 0 clamp(16px, 3vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg);
  color: var(--grey);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.footer a { color: inherit; text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* =========================================================
   MOBILE / NARROW
   ========================================================= */

@media (max-width: 820px) {

  :root {
    --content: 100vw;
    --gutter: 0px;
    --footer-h: 42px;
  }

  .wordmark { letter-spacing: 0.16em; padding-left: 0.16em; }

  /* tracking tightens on narrow phones so "IVY-LEAGUE EDUCATED CREATIVE
     MIND" always holds one line — the type size never drops below the
     statement's, so the two stay identical */
  .caption,
  .statement p { font-size: clamp(0.78rem, 3vw, 0.98rem); }

  .caption {
    letter-spacing: 0.13em;
    padding: 0 clamp(16px, 5vw, 40px);
    line-height: 1.85;
  }

  /* caption sits close under the photo; chevron drops to the bottom */
  .hero    { flex: 0 1 auto; margin-top: auto; }
  .caption { margin-top: clamp(12px, 2vh, 22px); }
  .arrow   { margin-top: auto; }

  /* image keeps its place, text always underneath */
  .split {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(20px, 3.4vh, 34px);
  }

  .portrait {
    width: 100%;
    /* full-bleed when there's room; capped by leftover height otherwise */
    max-width: min(100%, max(30%, calc((100svh - var(--header-h) - var(--veil-top)
                - var(--footer-h) - var(--veil-bot) - 210px) * 1.5)));
    flex: 0 1 auto;
  }

  .statement {
    padding: 0 clamp(22px, 7vw, 40px);
    text-align: center;
  }

  .statement p {
    max-width: 38ch;
    margin: 0 auto;
    line-height: 1.95;
  }

  .statement p + p { margin-top: 1em; }

  .footer { font-size: 9.5px; letter-spacing: 0.05em; }
}

@media (max-width: 430px) { .caption { letter-spacing: 0.11em; } }
@media (max-width: 375px) { .caption { letter-spacing: 0.08em; } }

@media (max-width: 380px) {
  .footer { font-size: 8.5px; letter-spacing: 0.03em; }
}

/* =========================================================
   SHORT VIEWPORTS (phones held sideways, tiny browser windows)
   shrink the fixed furniture to claw back vertical room
   ========================================================= */

@media (max-height: 520px) {

  :root {
    --veil-top: 20px;
    --veil-bot: 16px;
    --footer-h: 34px;
  }

  .masthead { padding: 10px 0 8px; }

  .wordmark {
    font-size: clamp(1rem, 4.4vh, 1.7rem);
    letter-spacing: 0.14em;
    padding-left: 0.14em;
  }

  .rule { margin-top: 7px; }

  .arrow      { margin-top: 8px; padding: 6px 14px; }
  .arrow--up  { margin: 0 0 8px; }
  .arrow svg  { width: 20px; }

  .caption { margin-top: 8px; line-height: 1.5; }

  .split { gap: 14px; }

  .statement p          { line-height: 1.6; }
  .statement p + p      { margin-top: 0.7em; }

  .portrait {
    max-width: min(100%, max(30%, calc((100svh - var(--header-h) - var(--veil-top)
                - var(--footer-h) - var(--veil-bot) - 150px) * 1.5)));
  }
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .arrow { animation: none; opacity: 0.55; }
}
