:root {
  --ink: #523c31;
  --ink-soft: #846f63;
  --cream: #f7f2ec;
  --paper: #fffdf9;
  --line: #e7ddd4;
  --rose: #c99185;
  --rose-dark: #a86f64;
  --sage: #71806a;
  --shadow: 0 22px 60px rgba(75, 52, 39, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background: var(--cream);
  font-family:
    "LINE Seed Sans TH",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgba(82, 60, 49, 0.08);
  background: rgba(247, 242, 236, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand img {
  /*width: 148px;
  height: auto;*/
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.back-link:hover {
  color: var(--rose-dark);
  transform: translateX(-3px);
}

.back-link:focus-visible,
.preview-link:focus-visible,
.demo-button:focus-visible,
.primary-button:focus-visible {
  outline: 3px solid rgba(201, 145, 133, 0.45);
  outline-offset: 4px;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(76px, 11vw, 132px) 20px clamp(68px, 9vw, 110px);
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(
    rgba(82, 60, 49, 0.1) 0.7px,
    transparent 0.7px
  );
  background-size: 16px 16px;
  opacity: 0.22;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 82%);
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.hero-glow {
  position: absolute;
  z-index: -1;
  width: 360px;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.34;
}

.hero-glow-left {
  left: -190px;
  top: 12%;
  background: radial-gradient(circle, #d5ddd0, transparent 68%);
}

.hero-glow-right {
  right: -170px;
  bottom: -20%;
  background: radial-gradient(circle, #ebd1cb, transparent 68%);
}

.hero-content {
  width: min(790px, 100%);
  margin: 0 auto;
}

.eyebrow,
.section-kicker,
.card-kicker {
  margin: 0;
  color: var(--rose-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 14px 0 18px;
  font-family: "LINE Seed Sans TH";
  font-size: clamp(3rem, 8vw, 6.4rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero-lead {
  width: min(660px, 100%);
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.2vw, 1.18rem);
}

.hero-note {
  width: fit-content;
  max-width: 100%;
  margin: 30px auto 0;
  padding: 10px 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 253, 249, 0.72);
  font-size: 0.9rem;
}

.hero-note span {
  min-width: 0;
}

.templates {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 12px 0 clamp(90px, 11vw, 150px);
}

.section-heading {
  margin-bottom: 34px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
}

.section-heading h2,
.features h2,
.closing-cta h2 {
  margin: 5px 0 0;
  font-family: "LINE Seed Sans TH", "Times New Roman", serif;
  font-size: clamp(2.1rem, 4.2vw, 3.55rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.section-heading > p {
  max-width: 400px;
  margin: 0 0 5px;
  color: var(--ink-soft);
  text-align: right;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.template-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(82, 60, 49, 0.1);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 8px 30px rgba(75, 52, 39, 0.06);
  transition:
    transform 240ms ease,
    box-shadow 240ms ease;
}

.template-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow);
}

.preview-link {
  display: block;
  text-decoration: none;
}

.preview-frame {
  position: relative;
  aspect-ratio: 4 / 4.45;
  margin: 0;
  overflow: hidden;
  background: #eee7df;
}

.preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.2, 0.65, 0.25, 1);
}

.template-card:hover .preview-frame img {
  transform: scale(1.035);
}

.style-number {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 42px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: #fff;
  background: rgba(42, 34, 29, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font:
    600 0.76rem/1 "LINE Seed Sans TH",
    serif;
}

.recommended {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  padding: 7px 13px;
  border-radius: 999px;
  color: #fff;
  background: rgba(82, 60, 49, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.78rem;
  font-weight: 700;
}

.card-content {
  padding: 25px 25px 27px;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-heading h3 {
  margin: 2px 0 0;
  font-family: "LINE Seed Sans TH", "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.1;
}

.palette {
  flex: 0 0 auto;
  display: flex;
}

.palette i {
  width: 22px;
  aspect-ratio: 1;
  margin-left: -5px;
  border: 2px solid var(--paper);
  border-radius: 50%;
}

.palette-botanical i:nth-child(1) {
  background: #657a5f;
}
.palette-botanical i:nth-child(2) {
  background: #bcc9a9;
}
.palette-botanical i:nth-child(3) {
  background: #e9e3cf;
}
.palette-elegant i:nth-child(1) {
  background: #ad7e73;
}
.palette-elegant i:nth-child(2) {
  background: #ddc3bc;
}
.palette-elegant i:nth-child(3) {
  background: #eee7df;
}
.palette-lanna i:nth-child(1) {
  background: #41281d;
}
.palette-lanna i:nth-child(2) {
  background: #9d7246;
}
.palette-lanna i:nth-child(3) {
  background: #d5b476;
}

.card-content > p {
  min-height: 78px;
  margin: 17px 0 22px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.demo-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

.demo-button {
  width: 100%;
  padding: 12px 18px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
}

.template-card-botanical .demo-button:hover {
  border-color: var(--sage);
  color: #fff;
  background: var(--sage);
}

.template-card-elegant .demo-button:hover {
  border-color: var(--rose-dark);
  color: #fff;
  background: var(--rose-dark);
}

.template-card-lanna .demo-button:hover {
  border-color: #674832;
  color: #fff;
  background: #674832;
}

.features {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto clamp(90px, 11vw, 150px);
  padding: clamp(34px, 6vw, 64px);
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  align-items: center;
  gap: 60px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 253, 249, 0.72);
}

.features h2 {
  max-width: 470px;
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.feature-list {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
}

.feature-list li {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  color: var(--ink-soft);
  background: var(--paper);
  box-shadow: 0 5px 18px rgba(75, 52, 39, 0.05);
}

.feature-list span {
  width: 25px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--sage);
  font-size: 0.8rem;
}

.closing-cta {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 36px;
  padding: clamp(42px, 7vw, 74px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 50px;
  overflow: hidden;
  border-radius: 34px;
  color: #fff;
  background: linear-gradient(135deg, #5b4337, #806053);
  box-shadow: var(--shadow);
}

.closing-cta .section-kicker {
  color: #e5bdb4;
}

.closing-cta h2 {
  max-width: 680px;
  color: #fff;
}

.closing-cta p:not(.section-kicker) {
  margin: 15px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.primary-button {
  flex: 0 0 auto;
  padding: 14px 24px;
  color: var(--ink);
  background: #fff;
}

.primary-button:hover {
  color: var(--rose-dark);
  transform: translateY(-2px);
}

.site-footer {
  padding: 54px 20px 46px;
  text-align: center;
}

.site-footer img {
  width: 126px;
  height: auto;
  margin: 0 auto 12px;
  opacity: 0.84;
}

.site-footer p {
  margin: 0 0 10px;
  color: var(--ink-soft);
}

.site-footer small {
  color: #a08e84;
}

@media (max-width: 920px) {
  .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-card:last-child {
    grid-column: 1 / -1;
    width: calc(50% - 12px);
    justify-self: center;
  }

  .features {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .closing-cta {
    align-items: flex-start;
    flex-direction: column;
    gap: 30px;
  }
}

@media (max-width: 640px) {
  .header-inner,
  .templates,
  .features,
  .closing-cta {
    width: min(calc(100% - 28px), 1180px);
  }

  .header-inner {
    min-height: 70px;
    gap: 12px;
  }

  .brand img {
    /* width: 122px; */
  }

  .back-link {
    font-size: 0.88rem;
    white-space: nowrap;
  }

  .hero {
    padding-top: 68px;
  }

  .hero h1 {
    font-size: clamp(2.4rem, 11.5vw, 3rem);
    letter-spacing: -0.03em;
  }

  .hero h1 span {
    display: block;
  }

  .hero-lead,
  .hero-note span,
  .section-heading > p {
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .hero-note {
    align-items: flex-start;
    width: 100%;
    border-radius: 18px;
    text-align: left;
    overflow-wrap: anywhere;
  }

  .hero-note svg {
    flex: 0 0 auto;
    margin-top: 3px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .section-heading > p {
    width: 100%;
    max-width: 100%;
    text-align: left;
    overflow-wrap: anywhere;
  }

  .template-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .template-card:last-child {
    grid-column: auto;
    width: auto;
  }

  .preview-frame {
    aspect-ratio: 4 / 4.3;
  }

  .card-content {
    padding: 23px 22px 25px;
  }

  .card-content > p {
    min-height: auto;
  }

  .features {
    padding: 30px 22px;
    border-radius: 25px;
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .closing-cta {
    padding: 38px 25px;
    border-radius: 26px;
  }

  .primary-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
