:root {
  --color-primary: #1b2430;
  --color-secondary: #145c3e;
  --color-accent: #145c3e;
  --color-background: #f6f7f4;
  --color-surface: #e7eee9;
  --color-text: #1b2430;
  --color-muted: #3e4a55;
  --color-cta: #145c3e;
  --line: rgba(27, 36, 48, 0.14);
  --pad: clamp(1.25rem, 4.5vw, 5rem);
  --display: "Trirong", "Noto Serif Thai", serif;
  --sans: "IBM Plex Sans Thai", "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.125rem;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection {
  background: #d5e6dc;
  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-background);
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  transform: none;
}

main:focus {
  outline: none;
}

#talk,
#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: var(--color-primary);
  color: var(--color-background);
}

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

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

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

.nav a:hover {
  color: #c9e6d6;
}

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

.hero {
  padding: clamp(2rem, 6vh, 3.4rem) var(--pad) 0;
}

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

h1,
h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.4;
}

h1 {
  max-width: 12em;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
}

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

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

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

.cta:hover {
  background: #0f4a32;
}

.frame {
  margin: clamp(1.5rem, 4vh, 2.2rem) calc(var(--pad) * -1) 0;
  height: clamp(11rem, 30vh, 17rem);
  background: var(--color-surface);
  overflow: hidden;
}

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

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

h2 {
  max-width: 12em;
  margin-bottom: 1rem;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
}

.points p {
  max-width: 36rem;
  padding: 0.85rem 0;
}

.points p + p {
  border-top: 1px solid var(--line);
}

.points span {
  display: block;
  color: var(--color-secondary);
  font-weight: 600;
}

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

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

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

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

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

.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: 500;
  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));
  background: var(--color-background);
  color: var(--color-text);
}

.foot .wordmark {
  color: var(--color-text);
}

.foot p {
  margin: 0;
}

@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-background);
    border-bottom: 1px solid var(--line);
  }

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

  .nav a {
    padding: 0.85rem 0;
    border-top: 1px solid var(--line);
    color: var(--color-text);
  }

  .frame {
    height: 12rem;
  }
}

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