/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  color-scheme: light;
  --paper: #f6f1e8;
  --paper-deep: #ede5d6;
  --ink: #1e2721;
  --ink-soft: #4b5751;
  --forest: #2e5a44;
  --forest-deep: #1c3529;
  --violet: #6a5aa8;
  --sage: #e3e9df;
  --lilac: #ece8f4;
  --mist: #b9cdbf;
  --line: rgb(30 39 33 / 12%);

  /* One tint per idea card */
  --card-1: #e3e9df;
  --card-2: #dfe9e2;
  --card-3: #e0eaec;
  --card-4: #efe8d9;
  --card-5: #ece8f4;
  --card-6: #f1e5dd;
  --card-7: #ebe4ec;

  --font-serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-sans: "Alegreya Sans", "Gill Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --container: 1200px;
  --radius: 28px;
  --radius-sm: 16px;
  --shadow: 0 1px 2px rgb(30 39 33 / 6%), 0 18px 40px -18px rgb(30 39 33 / 28%);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --header-h: 4.5rem;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html {
  overflow-x: clip;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1.1875rem, 0.4vw + 1.1rem, 1.25rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
}

a,
button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

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

::selection {
  background: var(--lilac);
  color: var(--ink);
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  flex-shrink: 0;
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sm {
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.3em;
  vertical-align: -0.05em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 50;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--forest);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ==========================================================================
   Buttons & links
   ========================================================================== */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.8rem 1.5rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.button:active {
  transform: translateY(1px);
}

.button--outline {
  border-color: var(--forest);
  color: var(--forest);
}

.button--outline:hover {
  background: var(--forest);
  color: var(--paper);
}

.text-link {
  color: var(--forest);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-thickness 0.15s;
}

.text-link:hover {
  text-decoration-thickness: 2px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.scroll-sentinel {
  position: absolute;
  top: 0;
  width: 1px;
  height: 8px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.site-header.is-scrolled {
  background: rgb(246 241 232 / 84%);
  box-shadow: 0 1px 0 var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(var(--container), 100% - 2 * var(--gutter));
  height: var(--header-h);
  margin-inline: auto;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.625rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark .icon {
  width: 1.1em;
  height: 1.1em;
  color: var(--forest);
  stroke-width: 1.5;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  position: relative;
  display: inline-block;
  padding-block: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 500;
  text-decoration: none;
}

.nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0.3rem;
  left: 0;
  height: 1.5px;
  background: var(--forest);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}

.nav a:hover::after {
  transform: scaleX(1);
}

.nav__cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--forest);
  border-radius: 999px;
  color: var(--forest);
  transition: background-color 0.2s, color 0.2s;
}

.nav__cta a::after {
  display: none;
}

.nav__cta a:hover {
  background: var(--forest);
  color: var(--paper);
}

.nav__cta .icon {
  width: 1em;
  height: 1em;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-block: clamp(2rem, 5vw, 4rem) clamp(4rem, 8vw, 6rem);
}

.hero__title {
  font-size: clamp(3rem, 6vw, 5.25rem);
  font-variation-settings: "opsz" 144;
  font-weight: 350;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.hero__title em {
  color: var(--forest);
  font-style: italic;
  font-weight: 300;
}

.hero__intro {
  max-width: 30rem;
  margin-top: clamp(1.5rem, 3vw, 2rem);
  color: var(--ink-soft);
}

.hero__intro strong {
  display: block;
  margin-top: 0.75rem;
  font-weight: 400;
}

.hero__media {
  position: relative;
  isolation: isolate;
  justify-self: center;
  width: min(100%, 460px);
}

/* Offset frame behind the photo */
.hero__media::before {
  content: "";
  position: absolute;
  inset: 1.5rem -1.25rem -1.25rem 1.5rem;
  z-index: -1;
  border: 1px solid var(--mist);
  border-radius: var(--radius);
}

.hero__photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  object-fit: cover;
  object-position: 50% 32%;
}

/* Line-drawn branch growing over the photo's corners. Markup comes from
   scripts/generate-sprig.py; the translate values put the photo corner at a fixed point
   of each viewBox, so change them together with the viewBox geometry. */
.sprig {
  --sprig-fill: var(--sage);
  --sprig-line: var(--forest);
  --sprig-bloom: var(--lilac);
  --sprig-bloom-line: var(--violet);
  position: absolute;
  z-index: 1;
  overflow: visible;
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.sprig--main {
  top: 0;
  right: 0;
  width: 70%;
  transform: translate(38%, -30.6%);
}

.sprig--small {
  bottom: 0;
  left: 0;
  width: 36%;
  transform: translate(-37.5%, 40%);
}

.sprig__halo {
  stroke: var(--paper);
  stroke-width: 6;
}

.sprig__stem {
  stroke: var(--forest);
  stroke-width: 1.75;
}

.js .sprig__halo,
.js .sprig__stem {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: sprig-draw 1.4s var(--ease-out) 0.3s forwards;
}

.js .sprig__leaf,
.js .sprig__floret {
  transform-origin: 0 0;
  animation: sprig-pop 0.6s var(--ease-out) var(--d, 0s) both;
}

@keyframes sprig-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes sprig-pop {
  from {
    opacity: 0;
    transform: scale(0);
  }
}

/* ==========================================================================
   Ideas
   ========================================================================== */

.ideas {
  width: min(860px, 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-block: clamp(4rem, 10vw, 8rem);
}

.idea-list {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.idea {
  --idea-bg: var(--card-1);
  position: relative;
  display: grid;
  grid-template-columns: 3rem 1fr;
  column-gap: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  border-radius: var(--radius);
  background: var(--idea-bg);
  transition: box-shadow 0.3s, transform 0.3s var(--ease-out);
}

.idea-list > li:nth-child(2) .idea { --idea-bg: var(--card-2); }
.idea-list > li:nth-child(3) .idea { --idea-bg: var(--card-3); }
.idea-list > li:nth-child(4) .idea { --idea-bg: var(--card-4); }
.idea-list > li:nth-child(5) .idea { --idea-bg: var(--card-5); }
.idea-list > li:nth-child(6) .idea { --idea-bg: var(--card-6); }
.idea-list > li:nth-child(7) .idea { --idea-bg: var(--card-7); }

.idea__head {
  display: contents;
}

.idea__num {
  grid-row: 1 / span 4;
  color: var(--violet);
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 5vw, 3.5rem);
  font-style: italic;
  font-variation-settings: "opsz" 144;
  font-weight: 300;
  line-height: 0.9;
  text-align: center;
}

.idea__icon {
  position: absolute;
  top: clamp(1.5rem, 4vw, 2.75rem);
  right: clamp(1.5rem, 4vw, 2.75rem);
  width: 2.25rem;
  height: 2.25rem;
  color: var(--forest);
  stroke-width: 1.2;
}

.idea__title {
  padding-right: 3rem;
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.idea__body {
  margin-top: 1rem;
}

.idea__body p + p,
.idea__solution-inner p + p {
  margin-top: 1em;
}

.idea__toggle {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.6rem;
  min-height: 2.75rem;
  margin-top: 1.5rem;
  padding: 0.65rem 1.1rem 0.65rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--forest);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.idea__toggle:hover {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--paper);
}

.idea__toggle .icon {
  transition: transform 0.35s var(--ease-out);
}

.idea.is-open .idea__toggle .icon {
  transform: rotate(180deg);
}

.idea__solution-inner::before {
  content: "";
  display: block;
  height: 1px;
  margin-top: 1.75rem;
  background: var(--line);
}

.idea__solution-inner > :first-child {
  margin-top: 1.5rem;
}

.idea__solution ul {
  margin: 0;
  padding-left: 1.25rem;
}

.idea__solution ul ul {
  margin-top: 0.4rem;
}

.idea__solution li + li {
  margin-top: 0.4rem;
}

.idea__solution li::marker {
  color: var(--violet);
}

/* Collapsing only applies when JS is available; otherwise everything stays readable. */
.js .idea__solution {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.45s var(--ease-out), visibility 0s linear 0.45s;
}

.js .idea.is-open .idea__solution {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 0.45s var(--ease-out), visibility 0s;
}

.js .idea__solution-inner {
  min-height: 0;
  overflow: hidden;
}

.js .idea:not(.is-open) {
  cursor: pointer;
}

.js .idea:not(.is-open):hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.no-js .idea__toggle {
  padding: 0;
  border: 0;
  background: none;
  pointer-events: none;
}

.no-js .idea__toggle .icon {
  display: none;
}

/* ==========================================================================
   About
   ========================================================================== */

.about {
  background: var(--paper-deep);
}

.about__inner {
  display: grid;
  grid-template-columns: 2fr 3fr;
  align-items: start;
  gap: clamp(2.5rem, 7vw, 6rem);
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-block: clamp(4rem, 9vw, 6.5rem);
}

.about__media {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  margin: 0;
}

.about__photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  object-fit: cover;
  object-position: 50% 33%;
}

.about__media figcaption {
  margin-top: 1.25rem;
  color: var(--forest);
  font-family: var(--font-serif);
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  font-style: italic;
  font-weight: 300;
  text-align: center;
}

.about__title {
  font-size: clamp(2.75rem, 5vw, 4rem);
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.about__lead {
  margin-top: clamp(1.5rem, 3vw, 2rem);
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.prose {
  max-width: 68ch;
  margin-top: clamp(1.5rem, 3vw, 2rem);
  color: var(--ink-soft);
}

.prose p + p {
  margin-top: 1.1em;
}

.about .button {
  margin-top: clamp(2rem, 4vw, 2.5rem);
}

/* ==========================================================================
   Contact & footer
   ========================================================================== */

.contact,
.site-footer {
  background: var(--forest-deep);
  color: var(--paper);
}

.contact__inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: clamp(2rem, 7vw, 6rem);
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-block: clamp(3.5rem, 8vw, 5rem);
}

.contact__title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.contact__note {
  max-width: 26rem;
  margin-top: 1.5rem;
  color: var(--mist);
}

.contact__links {
  display: grid;
  justify-items: start;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgb(185 205 191 / 45%);
  font-size: clamp(1.25rem, 2vw, 1.375rem);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.contact-link:hover {
  border-color: var(--mist);
  color: var(--mist);
}

.contact-link span {
  min-width: 0;
  font-variant-numeric: lining-nums;
  overflow-wrap: anywhere;
}

.contact-link__arrow {
  transition: transform 0.2s var(--ease-out);
}

.contact-link:hover .contact-link__arrow {
  transform: translateX(3px);
}

.contact :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--mist);
}

.site-footer {
  color: rgb(246 241 232 / 72%);
  font-size: 0.9375rem;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-block: 1.5rem;
  border-top: 1px solid rgb(246 241 232 / 14%);
}

.site-footer__top {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.site-footer__top:hover {
  color: var(--paper);
}

.site-footer__top .icon {
  width: 1em;
  height: 1em;
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out),
    box-shadow 0.3s;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .js .sprig * {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 959px) {
  .hero,
  .about__inner,
  .contact__inner {
    grid-template-columns: 1fr;
  }

  .hero__media {
    width: min(82%, 360px);
    margin-bottom: 1.25rem;
  }

  .sprig--main {
    width: 58%;
    transform: translate(26%, -30.6%);
  }

  .sprig--small {
    width: 30%;
    transform: translate(-22%, 40%);
  }

  .about__media {
    position: static;
    justify-self: center;
    width: min(88%, 380px);
  }

  .about__photo {
    aspect-ratio: 4 / 5;
  }
}

@media (max-width: 639px) {
  :root {
    --header-h: 4rem;
  }

  .wordmark {
    font-size: 1.375rem;
  }

  .nav a {
    font-size: 1rem;
  }

  .nav__cta {
    display: none;
  }

  .idea {
    grid-template-columns: 1fr;
  }

  .idea__num {
    grid-row: auto;
    margin-bottom: 0.5rem;
    text-align: start;
    font-size: 2.25rem;
  }

  .idea__icon {
    width: 2rem;
    height: 2rem;
  }

  .idea__title {
    padding-right: 0;
  }

  .site-footer__inner {
    font-size: 0.875rem;
  }
}

@media (max-width: 379px) {
  .wordmark .icon {
    display: none;
  }

  .nav {
    gap: 0.875rem;
  }
}
