:root {
  --color-primary: #1c1916;
  --color-secondary: #8e2f2a;
  --color-accent: #8e2f2a;
  --color-background: #f3efe8;
  --color-surface: #e7e1d8;
  --color-text: #1c1916;
  --color-muted: #4e4944;
  --color-cta: #1c1916;
  --line: rgba(28, 25, 22, 0.16);
  --pad: clamp(1.25rem, 4.5vw, 5rem);
  --display: "Taviraj", "Noto Serif Thai", serif;
  --sans: "Athiti", "Noto Sans Thai", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--sans);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection {
  background: #eadcd4;
  color: var(--color-text);
}

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

.skip {
  position: absolute;
  z-index: 40;
  left: var(--pad);
  top: 0.75rem;
  transform: translateY(-160%);
  padding: 0.55rem 0.9rem;
  background: var(--color-primary);
  color: var(--color-background);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  transform: none;
}

main:focus {
  outline: none;
}

#care,
#who,
#contact {
  scroll-margin-top: 4.6rem;
}

.top,
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-inline: var(--pad);
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: calc(0.75rem + env(safe-area-inset-top));
  padding-bottom: 0.75rem;
  background: rgba(243, 239, 232, 0.94);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: var(--color-text);
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 1.4rem;
}

.nav a {
  color: var(--color-text);
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  color: var(--color-secondary);
}

.menu {
  display: none;
  min-height: 2.75rem;
  padding: 0.3rem 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(16rem, 0.8fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: end;
  padding: clamp(2rem, 6vh, 4rem) var(--pad) clamp(2rem, 5vh, 3.2rem);
}

.kicker {
  margin: 0 0 0.45rem;
  color: var(--color-secondary);
  font-weight: 600;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
}

h1 {
  font-size: clamp(2.3rem, 4.4vw, 3.7rem);
  font-weight: 600;
  line-height: 1.35;
}

.lede,
.notes p,
.who p,
.contact p {
  margin: 0;
}

.lede {
  max-width: 36rem;
  margin-top: 0.9rem;
  color: var(--color-muted);
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 2.9rem;
  margin-top: 1.15rem;
  padding: 0.4rem 1.15rem;
  background: var(--color-cta);
  color: var(--color-background);
  font-weight: 600;
  text-decoration: none;
}

.cta:hover {
  background: #332e2a;
}

.frame {
  margin: 0;
  aspect-ratio: 1;
  background: var(--color-surface);
  overflow: hidden;
}

.frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 70%;
}

.care {
  padding: clamp(2.4rem, 6vw, 4.2rem) var(--pad);
  background: var(--color-surface);
}

h2 {
  margin-bottom: 1.1rem;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.35;
}

.notes article + article {
  margin-top: 1.15rem;
}

.notes h3 {
  font-size: 1.55rem;
  line-height: 1.35;
}

.notes p {
  color: var(--color-muted);
}

.who {
  padding: clamp(2.4rem, 6vw, 4rem) var(--pad);
}

.who p {
  max-width: 36rem;
  margin-top: 0.45rem;
  color: var(--color-muted);
}

.contact {
  padding: clamp(2.4rem, 7vw, 4.4rem) var(--pad);
  background: var(--color-primary);
  color: var(--color-background);
}

.contact .kicker,
.contact h2,
.contact p,
.mail {
  color: var(--color-background);
}

.contact .cta {
  background: var(--color-background);
  color: var(--color-primary);
}

.contact .cta:hover {
  background: #ffffff;
}

.contact .cta:focus-visible,
.mail:focus-visible {
  outline-color: var(--color-background);
}

.mail {
  display: inline-block;
  margin-top: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.mail:hover {
  text-decoration: underline;
}

.foot {
  padding-top: 1.05rem;
  padding-bottom: calc(1.05rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.foot .wordmark {
  font-size: 1.35rem;
}

.foot p {
  margin: 0;
}

@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .frame {
    order: 2;
    max-width: 22rem;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .menu {
    display: inline-flex;
    align-items: center;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.25rem var(--pad) 0.7rem;
    background: var(--color-primary);
  }

  .top.is-open .nav {
    display: flex;
  }

  .nav a {
    padding: 0.85rem 0;
    border-top: 1px solid rgba(243, 239, 232, 0.2);
    color: var(--color-background);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
