/* ellie-baker.org — one page, no external requests. */

/* Inter Light — an open neo-grotesque close to Helvetica Neue Light.
   Self-hosted and subset (SIL OFL 1.1, licence in fonts/). No call out to
   Google, so nothing leaves the visitor's browser. */
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* Real bold cut, so the link isn't a browser-synthesized fake bold. */
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:    #fdfdfc;
  --text:  #1a1a18;
  --hi:      #5ea9e8;  /* the "Hi!" blue */
  --link:    var(--hi);
  --focus: #0b5cd5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:    #16161a;
    --text:  #ececef;
    --hi:      #8cc2f4;
    --link:    var(--hi);
    --focus: #7fb2ff;
  }
}

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

/* The full-bleed rules are 100vw wide, which exceeds the visible width when a
   scrollbar is present; clip rather than let that cause sideways scrolling. */
html { overflow-x: clip; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  padding: clamp(3rem, 7vh, 5rem) clamp(1.25rem, 5vw, 3rem) 5rem;
  font: 300 1rem/1.65 "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* One column shared by the heading and the body row, centred as a block so the
   composition stays balanced on wide screens. The content inside stays
   left-aligned, so it still reads as anchored left rather than centred. */
.name,
main {
  max-width: 52rem;
  margin-inline: auto;
}

/* Big, rounded and blue — closest match to the hand-drawn lettering using
   fonts already on the machine, so the page stays dependency-free. */
.name {
  /* Bottom margin only: "Hi!" stays put and the photo/text move down. */
  margin: 0 auto 2.75rem;
  /* Same face as the body text, just much larger. */
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(3rem, 7vw, 4.5rem);
  font-weight: 300;
  line-height: 1.05;
  /* Large light type looks loose by default; pull it in slightly. */
  letter-spacing: -0.02em;
  color: var(--hi);
}

/* A short "i", about half the height of the H. */
.name .small-i {
  font-size: 0.5em;
}

main {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  padding-block: 2.75rem;
  position: relative;
}

/* Hairline rules above and below, in the heading blue. They break out of the
   centred column to span the full viewport width: 100vw, pulled back to the
   left edge from the element's own centre. */
main::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  background: var(--hi);
}

/* The lower rule is anchored to the window, not to the text: fixed positioning
   keeps it a set distance above the bottom edge whatever the content does. */
main::after {
  content: "";
  position: fixed;
  left: 0;
  bottom: 1in;
  width: 100vw;
  height: 1px;
  background: var(--hi);
}

.portrait {
  flex: none;
  width: 13rem;
  height: auto;
  max-width: 100%;
  border-radius: 3px;
}

.text { padding-top: 0.15rem; }

/* Both statements share one style: same family, size, weight and colour. */
.intro {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 300;
  /* A touch more leading, since a light sans needs more air than the serif. */
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--text);
}

/* The gap between the two statements — about one blank line, as drawn. */
.intro.spaced { margin-top: 2rem; }

a {
  color: var(--link);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Stack on narrow screens, photo still first. */
@media (max-width: 34rem) {
  body { padding: 2rem 1.25rem 3rem; }
  /* Less reserve on a phone, where an inch is a larger share of the screen. */
  main::after { bottom: 0.7in; }
  .name { margin-bottom: 2rem; }
  main {
    flex-direction: column;
    gap: 1.75rem;
    padding-block: 2rem;
  }
  .portrait { width: 10rem; }
  .intro { font-size: 1.2rem; }
  .intro.spaced { margin-top: 1.75rem; }
}
