@font-face {
  font-family: 'Noto Sans Thai';
  src: url('thai.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0E01-0E5B;
}

@font-face {
  font-family: 'Noto Serif Thai';
  src: url('thai-serif.woff2') format('woff2');
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0E01-0E5B;
}

:root {
  color-scheme: light;
  --paper: #fbf8ef;
  --white: #fffdf5;
  --ink: #19383b;
  --muted: #4c6261;
  --sea: #20575b;
  --line: #d9ded1;
  --gutter: clamp(1.2rem, 5vw, 4.5rem);
  --public-header-inner-height: 3.6rem;
  --display: 'Noto Serif Thai', 'Noto Sans Thai', serif;
  font-family: 'Noto Sans Thai', 'Leelawadee UI', system-ui, sans-serif;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body, p, h1, h2, h3 { margin: 0; }
body { display: flex; flex-direction: column; min-height: 100vh; isolation: isolate; }
main { flex: 1; }
a { color: inherit; }
img { display: block; width: 100%; height: auto; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.wrap { width: min(74rem, calc(100% - var(--gutter) * 2)); margin-inline: auto; }

.site-meadow {
  position: fixed;
  inset: 0 0 auto;
  z-index: -3;
  width: 100%;
  height: 145vh;
  height: 145svh;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
}
.petal-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.petal {
  --petal-pink: #dc879f;
  --petal-edge: #a44471;
  position: absolute;
  top: var(--petal-top);
  left: var(--petal-left);
  width: var(--petal-size);
  aspect-ratio: 2.1;
  opacity: 0.3;
  transform: translate3d(
    calc(var(--petal-scroll-x, 0px) * var(--petal-depth)),
    calc(var(--petal-scroll-y, 0px) * var(--petal-depth)),
    0
  );
}
.petal:nth-child(3n) {
  --petal-pink: #bb8fc8;
  --petal-edge: #774b9b;
}
.petal--near {
  opacity: 0.24;
  filter: blur(3px);
}
.petal::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 76% 35% 70% 31% / 72% 61% 45% 35%;
  background:
    radial-gradient(ellipse at 73% 23%, #fff1f1dc, transparent 58%),
    linear-gradient(145deg, #ffdce6, var(--petal-pink) 60%, var(--petal-edge));
  box-shadow: inset 0 -0.12rem 0.22rem #803e7328;
  animation: petal-drift var(--petal-duration) ease-in-out var(--petal-delay) infinite alternate;
}
.petal:nth-child(2n)::before {
  border-radius: 49% 76% 40% 63% / 38% 67% 58% 72%;
}
@keyframes petal-drift {
  from { transform: translate3d(-10px, -7px, 0) rotate(calc(var(--petal-angle) - 15deg)) scaleY(0.82); }
  to { transform: translate3d(19px, 13px, 0) rotate(calc(var(--petal-angle) + 19deg)) scaleY(0.99); }
}
.meadow-panel {
  padding-inline: clamp(1.2rem, 3.5vw, 3.2rem);
  border-radius: 0 0 0.85rem 0.85rem;
  background: var(--white);
  box-shadow: 0 0.9rem 2.3rem #19383b22;
}
.meadow-panel--transparent {
  background: transparent;
  box-shadow: none;
}

.site-intro {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  color: var(--ink);
  background: var(--white);
  transition: opacity 220ms ease, visibility 0s linear 220ms;
}
.show-site-intro .site-intro {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: none;
}
.site-intro__brand {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.15rem);
  max-width: 100%;
}
.site-intro__cat {
  flex: none;
  width: clamp(3.5rem, 15vw, 6.25rem);
  aspect-ratio: 1;
  background: url('images/cat-walk.webp') 0 0 / 1600% 100% no-repeat;
  transform: scaleX(-1);
}
.play-site-intro .site-intro__cat {
  animation: cat-walk 1.6s steps(16, jump-none) infinite;
}
.site-intro__name {
  font: 700 clamp(1.6rem, 7.3vw, 4.3rem)/1.08 Georgia, serif;
  overflow-wrap: anywhere;
}

@keyframes cat-walk {
  to { background-position-x: 100%; }
}

.skip-link {
  position: fixed;
  inset: 0.75rem auto auto 0.75rem;
  z-index: 5;
  padding: 0.5rem 0.85rem;
  transform: translateY(-180%);
  color: var(--white);
  background: var(--sea);
}
.skip-link:focus { transform: none; }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: 2rem;
  min-height: 4.8rem;
}
#page-top .header-inner { min-height: var(--public-header-inner-height); }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  white-space: nowrap;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 720;
}
.wordmark-mark {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}
nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: clamp(1.1rem, 3vw, 2.65rem);
}
nav a {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 2.8rem;
  color: var(--muted);
  font-size: 0.94rem;
  text-decoration: none;
  white-space: nowrap;
}
nav a:hover, nav a[aria-current] { color: var(--ink); }
nav a[aria-current] { font-weight: 740; }
nav a[aria-current]::after {
  position: absolute;
  inset: auto 0 0.18rem;
  height: 2px;
  border-radius: 2px;
  background: #8f672c;
  content: '';
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.23; }
h1 { font-size: clamp(2.65rem, 5.4vw, 5.1rem); }
h2 { font-size: clamp(1.8rem, 3.7vw, 3rem); }
h3 { font-size: 1.55rem; }
.lead { font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 650; line-height: 1.55; }

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.3rem;
  border: 1px solid var(--sea);
  border-radius: 0.25rem;
  background: var(--sea);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}
.button:hover { background: #164348; }

.home-hero, .goal-hero {
  position: relative;
  display: grid;
  align-items: center;
}
[data-intro-home] { --home-header-height: calc(var(--public-header-inner-height) + 1px); }
.home-hero {
  align-items: start;
  min-height: calc(100vh - var(--home-header-height));
  min-height: calc(100dvh - var(--home-header-height));
  color: var(--white);
}
.hero-image, .home-hero::before, .home-hero::after, .goal-hero::after {
  position: absolute;
  inset: 0;
  /* The opening scenes cover the petals until the meadow comes into view. */
  z-index: -1;
}
.hero-image { width: 100%; height: 100%; object-fit: cover; object-position: center center; }
.home-hero::before, .home-hero::after, .goal-hero::after { content: ''; }
.home-hero::before { background: #25484e; }
.home-hero::after {
  background: linear-gradient(90deg, #112e37ec, #112e37c9 29%, #112e376e 51%, #112e3708 88%);
}
.hero-inner { padding-block: clamp(2.5rem, 7vw, 5rem) 4rem; }
.hero-copy { max-width: 31rem; }
.home-hero h1 {
  font-size: clamp(2rem, 11vw, 4.65rem);
  line-height: 1.13;
  overflow-wrap: anywhere;
}
.hero-description { max-width: 24rem; margin-top: 1.3rem; font-size: clamp(1.05rem, 1.7vw, 1.25rem); }

.home-index { padding-block: clamp(3rem, 6vw, 5rem); }
.chapter-grid, .interest-list { list-style: none; padding: 0; }
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.8rem, 2vw, 1.7rem);
  margin: 1.75rem 0 0;
}
.chapter-grid.home-chapter-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
}
.chapter-card {
  display: block;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
}
.chapter-card img { aspect-ratio: 1.85; object-fit: cover; background: #d4e5df; }
.chapter-copy { padding: 1rem 1.15rem 1.25rem; }
.chapter-copy p { margin-top: 0.35rem; color: var(--muted); }
.chapter-card:hover :is(h2, h3) { text-decoration: underline; text-underline-offset: 0.17em; }

.portfolio-layout > h1, .portfolio-intro, .portfolio-gallery-note { text-align: center; }
.portfolio-intro, .portfolio-gallery-note { margin-top: 0.65rem; }
.portfolio-layout > h1, .portfolio-intro, .portfolio-gallery-note, .about-copy {
  text-shadow: 0 1px 2px #fff8e9, 0 0 0.8rem #fff8e9d9;
}
.portfolio-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  min-inline-size: 0;
  margin: 1.4rem 0 0;
  padding: 0;
  border: 0;
}
.portfolio-categories legend, .portfolio-categories input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
}
.portfolio-categories label {
  display: grid;
  place-items: center;
  flex: 0 1 10rem;
  max-inline-size: calc((100% - 0.65rem) / 2);
  min-block-size: 2.8rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--sea);
  border-radius: 999px;
  color: var(--sea);
  background: var(--white);
  font-weight: 650;
  cursor: pointer;
}
.portfolio-categories label:hover { background: #e7efe9; }
.portfolio-categories input:checked + label {
  color: var(--white);
  background: var(--sea);
}
.portfolio-categories input:focus-visible + label {
  outline: 2px solid var(--sea);
  outline-offset: 3px;
}
.portfolio-panel { flex: 0 0 100%; min-inline-size: 0; }
#category-websites:checked ~ #portfolio-photos,
#category-photos:checked ~ #portfolio-websites { display: none; }
.portfolio-layout .chapter-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.portfolio-layout .portfolio-website-grid {
  margin-inline: auto;
}
.portfolio-layout .portfolio-website-grid:has(> li:only-child) { max-width: 30rem; }
.portfolio-website-grid .chapter-card {
  border-color: #19383b4d;
  background: transparent;
}
.portfolio-website-grid .chapter-copy { background: var(--white); }
.portfolio-layout .chapter-copy h2 { font-size: 1.55rem; overflow-wrap: anywhere; }
.portfolio-website-grid .chapter-copy p { overflow-wrap: anywhere; white-space: pre-line; }
.portfolio-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.65rem, 1.25vw, 1.25rem);
  margin: clamp(1rem, 2vw, 1.5rem) 0 0;
  padding: 0;
  list-style: none;
}
.portfolio-photo {
  display: block;
  overflow: hidden;
  border-radius: 0.2rem;
}
.portfolio-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #d4e5df;
}
@media (max-width: 950px) {
  .portfolio-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .portfolio-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#gallery-status:empty { display: none; }
.portfolio-gallery-more, .portfolio-gallery-manage {
  margin: 1rem auto 0;
  color: var(--sea);
  font: inherit;
  font-weight: 650;
}
.portfolio-gallery-more {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: var(--white);
  cursor: pointer;
}
.portfolio-gallery-manage { display: table; text-underline-offset: 0.18em; }
.portfolio-gallery-manage[hidden] { display: none; }

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(2rem, 5.5vw, 5rem);
  padding-block: clamp(3rem, 8vw, 7rem);
}
.about-layout--text-only { grid-template-columns: minmax(0, 1fr); }
.about-layout--text-only .about-copy { max-width: 46rem; }
.about-copy, .goal-copy, [data-edited] { overflow-wrap: anywhere; }
.lead + .page-story { margin-top: 0.85rem; }
.page-story { color: var(--muted); }
.page-story[data-edited], .interest-list[data-edited] p { white-space: pre-line; }
.about-copy h1, .goal-copy h1 { margin-bottom: 1.2rem; }
.about-copy p + p, .goal-copy p + p { margin-top: 0.85rem; }
.about-copy .page-story, .goal-copy .page-story { color: inherit; }
.about-copy .button, .goal-copy .button { margin-top: 1.5rem; text-shadow: none; }
.about-image {
  width: 100%;
  aspect-ratio: 1.2;
  object-fit: cover;
  border-radius: 0.45rem;
  box-shadow: 0 1rem 2.5rem #19383826;
  background: #d4e5df;
}

.interest-layout { padding-block: clamp(2.75rem, 6.5vw, 5.6rem); }
.interest-image {
  width: 100%;
  height: clamp(15rem, 30vw, 24rem);
  object-fit: cover;
  object-position: center 53%;
  margin-top: 1.65rem;
  border-radius: 0.45rem;
  background: #d4e5df;
}
.interest-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1.85rem 0 0;
  border-block: 1px solid var(--line);
}
.interest-list li { padding: 1.25rem 1.15rem; }
.interest-list li:first-child { padding-inline-start: 0; }
.interest-list li + li { border-inline-start: 1px solid var(--line); }
.interest-list h2 { font-size: 1.55rem; }
.interest-list p { margin-top: 0.35rem; color: var(--muted); }
.interest-list[data-edited] { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.interest-list[data-edited] li { padding: 1.25rem 1.15rem; border-inline-start: 0; }

.goal-screen {
  --goal-transition-height: 2rem;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh + var(--goal-transition-height));
  min-height: calc(100dvh + var(--goal-transition-height));
}
.goal-screen > main { display: grid; }
.goal-hero {
  padding-block-end: var(--goal-transition-height);
  background: transparent;
}
.goal-hero .hero-image, .goal-hero::after {
  mask-image: linear-gradient(#000 calc(100% - var(--goal-transition-height)), transparent);
}
.goal-hero::after {
  background: linear-gradient(90deg, #122e36ed, #122e36ad 44%, #122e3638 74%, transparent);
}
.goal-inner { padding-block: clamp(2.5rem, 6vw, 5rem); }
.goal-copy {
  max-width: 33rem;
  color: var(--white);
  text-shadow: 0 1px 0.5rem #122e36b3;
}
.goal-copy h1 { font-size: clamp(2.55rem, 4.6vw, 4.15rem); }

.site-footer {
  background: linear-gradient(180deg, transparent 7%, #fbf8ef44 32%, #fbf8efda 66%, var(--paper) 95%);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  min-height: clamp(22rem, 58svh, 37rem);
  padding-block: clamp(8rem, 21svh, 14.5rem) clamp(1.6rem, 4vw, 2.75rem);
  text-align: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.5vw, 0.9rem);
  max-width: 100%;
  font: 700 clamp(1.6rem, 5vw, 3.5rem)/1.1 Georgia, serif;
  overflow-wrap: anywhere;
}
.footer-brand img { flex: none; width: clamp(2.75rem, 5.5vw, 3.75rem); height: auto; }
.footer-socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.footer-socials a {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  color: var(--white);
  background: var(--ink);
}
.footer-socials a:hover { background: var(--sea); }
.footer-socials a:focus-visible { outline-color: var(--sea); }

@media (max-width: 720px) {
  :root { --public-header-inner-height: 5.05rem; }
  .header-inner { min-height: auto; flex-direction: column; align-items: flex-start; padding-top: 0.8rem; }
  #page-top .header-inner { padding-block: 0.15rem; }
  #page-top .wordmark-mark { width: 2rem; height: 2rem; }
  nav { width: 100%; justify-content: space-between; column-gap: 0.7rem; }
  nav a { min-height: 2.95rem; }
  #page-top nav a { min-height: 2.75rem; }
  nav a[aria-current]::after { bottom: 0.38rem; }
  .hero-image { object-position: 62% center; }
  .home-hero::after { background: linear-gradient(90deg, #112e37df, #112e37a6 60%, #112e3745); }
  .goal-hero::after { background: linear-gradient(90deg, #122e36e6, #122e36b8); }
  .chapter-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
  .home-chapter-grid .chapter-copy { padding: 0.75rem; }
  .home-chapter-grid h3 { font-size: clamp(1.125rem, 3.2vw, 1.55rem); }
  .about-layout { grid-template-columns: minmax(0, 1fr); }
  .about-image { max-height: 28rem; }
  .interest-list { grid-template-columns: minmax(0, 1fr); }
  .interest-list li { padding-inline: 0; }
  .interest-list li + li { border-inline-start: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 350px) {
  nav a { font-size: 0.86rem; }
}
@media (max-width: 600px) {
  .meadow-panel { width: 100%; padding-inline: var(--gutter); border-radius: 0; }
  .petal { width: calc(var(--petal-size) * 0.66); }
  .petal:nth-child(n+5) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .site-intro, .petal-layer { display: none; }
  .button { transition: none; }
}
