/* axolet.com shared styles */

@font-face {
  font-family: "Young Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/young-serif.woff2) format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/fonts/atkinson-next.woff2) format("woff2");
}

/* pond by day, pond by night */
:root {
  color-scheme: light dark;
  --pond: #e4ebe4;
  --ink: #1d2b27;
  --reed: #566a63;
  --silt: #c6d3ca;
  --gill: #c9496a;
  --skin: #f6c6d0;
  --eye: #1d2b27;

  --serif: "Young Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --pond: #13201b;
    --ink: #e1eae4;
    --reed: #93a79f;
    --silt: #2a3b34;
    --gill: #ef7f9a;
    --skin: #f6c6d0;
    --eye: #13201b;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--pond);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0 var(--gutter);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--skin); color: #1d2b27; }

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

/* links: a quiet underline that warms to gill pink */
.link {
  text-decoration: underline;
  text-decoration-color: var(--silt);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}
.link:hover { text-decoration-color: var(--gill); }

/* ---------- the mark: the period in "axolet." is an axolotl ---------- */

.mark {
  display: inline-block;
  width: 0.52em;
  height: 0.3em;
  margin-left: -0.015em;
  margin-right: -0.2em;
  vertical-align: -0.02em;
  overflow: visible;
}
.mark .head { fill: var(--skin); }
.mark .eye { fill: var(--eye); }
.mark .smile { fill: none; stroke: var(--eye); stroke-width: 1.6; stroke-linecap: round; }
.mark .gill { stroke: var(--gill); fill: none; stroke-linecap: round; stroke-linejoin: round; transform-box: view-box; transform-origin: 18px -2px; }
.mark .stalk { stroke-width: 3.4; }
.mark .barbs { stroke-width: 2.2; }

@media (prefers-reduced-motion: no-preference) {
  /* one moment on load: the head surfaces, then the gills unfurl from their roots */
  .mark .face {
    transform-box: fill-box;
    transform-origin: 50% 60%;
    animation: surface 1.1s cubic-bezier(0.34, 1.25, 0.64, 1) 0.5s backwards;
  }
  .mark .gill {
    animation: unfurl 1.8s cubic-bezier(0.22, 1, 0.36, 1) 0.75s backwards;
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
  }
  .mark .g2 { animation-delay: 0.85s; transition-delay: 0.04s; }
  .mark .g3 { animation-delay: 0.95s; transition-delay: 0.08s; }

  /* pointing at the name makes the gills perk up, and they settle back when you leave */
  :is(.wordmark, .home-link):hover .mark .g1 { transform: rotate(-10deg); }
  :is(.wordmark, .home-link):hover .mark .g2 { transform: rotate(-7deg); }
  :is(.wordmark, .home-link):hover .mark .g3 { transform: rotate(-4deg); }
}
@keyframes unfurl {
  from { transform: rotate(-28deg) scale(0.2); opacity: 0; }
  35% { opacity: 1; }
}
@keyframes surface {
  from { transform: translateY(30%) scale(0.6); opacity: 0; }
  60% { opacity: 1; }
}

/* ---------- home ---------- */

.home {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 2.5vw, 2rem);
  align-content: space-between;
  row-gap: clamp(3rem, 8vh, 6rem);
  width: 100%;
  max-width: 84rem;
  margin: 0 auto;
  padding: clamp(2rem, 7vh, 5rem) 0 clamp(2.5rem, 6vh, 4rem);
}

.intro { grid-column: 1 / -1; }

.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4.75rem, 22vw, 15rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
  margin-left: -0.05em; /* optical: pull the a's bowl to the text edge */
  white-space: nowrap;
}

.tagline {
  margin-top: clamp(1.25rem, 3.5vh, 2rem);
  max-width: 17em;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3.2vw, 2.15rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--reed);
  text-wrap: balance;
}

.projects {
  grid-column: 7 / -1;
  align-self: end;
}
.projects h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.0625rem;
  color: var(--reed);
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid var(--silt);
}

.project {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1.25rem;
  padding-top: 1.5rem;
}
.project img {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.9rem;
  grid-row: 1 / span 2;
}
.project h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1;
  letter-spacing: -0.015em;
  margin-top: 0.1rem;
}
.project h3 a { text-decoration: none; }
.project h3 a:hover { color: var(--gill); }
.project p { margin-top: 0.6rem; max-width: 30em; color: var(--reed); }
.project .links {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin-top: 1.1rem;
  list-style: none;
}

/* ---------- footer ---------- */

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  width: 100%;
  max-width: 84rem;
  margin: 0 auto;
  padding: 1.5rem 0;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  justify-content: space-between;
  color: var(--reed);
  font-size: 0.9375rem;
}
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gill); text-decoration-thickness: 1.5px; text-underline-offset: 0.22em; }

/* ---------- page load: one sequence ---------- */

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 1.2s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
  .d2 { animation-delay: 0.15s; }
  .d3 { animation-delay: 0.35s; }
  @keyframes rise { from { opacity: 0; transform: translateY(16px); } }
}

/* ---------- small screens ---------- */

@media (max-width: 52rem) {
  /* stacked: keep the sections together and centre them, instead of pinning projects to the bottom */
  .home { align-content: center; row-gap: clamp(3.5rem, 9vh, 5rem); }
  .projects { grid-column: 1 / -1; }
}
@media (max-width: 30rem) {
  .project { column-gap: 1rem; }
  .project img { width: 3rem; height: 3rem; border-radius: 0.75rem; }
}

/* ---------- 404 ---------- */

.page-head {
  width: 100%;
  max-width: 84rem;
  margin: 0 auto;
  padding: 1.75rem 0;
}
.page-head .home-link {
  font-family: var(--serif);
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
}

.reading {
  flex: 1;
  width: 100%;
  max-width: 84rem;
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 5rem) 0 clamp(3rem, 10vh, 6rem);
}
.reading > * { max-width: 34rem; }
.reading h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  max-width: none;
}
.reading p { margin-top: 1rem; }
.reading .lede { margin-top: 1.5rem; font-size: 1.25rem; line-height: 1.5; color: var(--reed); }
