:root {
  --paper: #fbfaf7;
  --paper-strong: #ffffff;
  --ink: #231f20;
  --muted: #6d6462;
  --soft: #efe8de;
  --line: #d9cfc2;
  --red: #a61e22;
  --red-deep: #80161a;
  --gold: #b08342;
  --gold-soft: #e7d2aa;
  --shadow: 0 24px 60px rgba(54, 33, 23, 0.12);
  --max: 1180px;
  --sans: "IBM Plex Sans Thai", "Segoe UI", Tahoma, sans-serif;
  --serif: "Noto Serif Thai", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(166, 30, 34, 0.035) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(176, 131, 66, 0.05), transparent 34rem);
  background-size: 88px 100%, 100% 100%;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 16px 36px;
  color: var(--ink);
  background: rgba(251, 250, 247, 0.82);
  border-bottom: 1px solid rgba(217, 207, 194, 0.6);
  backdrop-filter: blur(18px);
  transition: min-height 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.site-header.is-scrolled {
  min-height: 62px;
  background: rgba(251, 250, 247, 0.94);
  box-shadow: 0 12px 34px rgba(41, 30, 24, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 4px;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.nav a {
  position: relative;
  padding: 4px 0;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--red);
}

.nav a:hover::after,
.nav a.is-active::after {
  transform: scaleX(1);
}

.section-inner {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.section-bleed {
  width: 100%;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  min-height: 92vh;
  padding-top: 72px;
  overflow: hidden;
  background:
    linear-gradient(112deg, var(--paper) 0 48%, transparent 48% 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(250, 246, 239, 0.2));
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  max-width: 660px;
  min-height: 720px;
  padding: 184px 56px 72px max(56px, calc((100vw - var(--max)) / 2));
}

.hero-title-prefix {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-role {
  margin-bottom: 26px;
  color: var(--red);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.55;
}

.accent-line {
  width: 72px;
  height: 2px;
  margin-bottom: 28px;
  background: var(--gold);
}

.hero-summary {
  max-width: 560px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 17px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 4px;
  border: 1px solid var(--red);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

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

.button.primary {
  color: #fff;
  background: var(--red);
}

.button.subtle {
  color: var(--red);
  background: rgba(255, 255, 255, 0.5);
}

.button[download] {
  border-color: var(--red-deep);
  background: linear-gradient(135deg, var(--red), var(--red-deep));
}

.hero-media {
  position: relative;
  min-height: 720px;
  clip-path: polygon(13% 0, 100% 0, 100% 100%, 0 100%);
  background: #e9e2d8;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(251, 250, 247, 0.16), transparent 30%);
  pointer-events: none;
}

.hero-media img {
  width: 100%;
  height: 100%;
  min-height: 720px;
  object-fit: cover;
  object-position: 44% center;
}

.hero-side {
  display: grid;
  gap: 3px;
  max-width: 220px;
  margin: 0 0 28px;
  padding-left: 14px;
  color: var(--muted);
  border-left: 2px solid var(--gold);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.profile,
.experience,
.talks {
  padding: 96px 0;
}

.profile-grid {
  display: grid;
  grid-template-columns: 0.9fr 1fr;
  gap: 56px 64px;
  align-items: start;
}

.profile-photo {
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.profile-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
}

.profile-copy h2,
.section-heading h2,
.awards-copy h2,
.research-copy h2,
.contact-title h2 {
  margin-bottom: 18px;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.28;
}

.section-label {
  margin-bottom: 10px;
  color: var(--red);
  font-size: 15px;
  font-weight: 700;
}

.profile-copy p,
.section-heading p,
.awards-copy p,
.research-copy p,
.contact-title p {
  color: var(--muted);
}

.education-panel {
  grid-column: 2;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
}

.education-panel h3 {
  margin-bottom: 18px;
  color: var(--red);
  font-size: 20px;
}

.education-panel ul,
.award-list,
.talk-list,
.publication-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.education-panel li {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.education-panel span {
  color: var(--ink);
  font-weight: 700;
}

.expertise {
  padding: 88px 0;
  background: var(--paper-strong);
  border-block: 1px solid var(--line);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 42px;
}

.section-heading.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.72fr);
  gap: 48px;
  max-width: none;
  align-items: end;
}

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.expertise-item {
  min-height: 220px;
  padding: 28px 22px;
  border-right: 1px solid var(--line);
}

.expertise-item:last-child {
  border-right: 0;
}

.expertise-item span {
  display: inline-block;
  margin-bottom: 36px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
}

.expertise-item h3 {
  margin-bottom: 10px;
  color: var(--red);
  font-size: 18px;
  line-height: 1.35;
}

.expertise-item p,
.timeline-item p,
.award-item p,
.talk-item p,
.publication p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  padding-top: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gold);
}

.timeline-item {
  position: relative;
  padding: 48px 20px 0 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--gold);
  border-radius: 999px;
  background: var(--paper);
}

.timeline-item time,
.award-item time,
.talk-item time,
.publication time {
  display: block;
  margin-bottom: 8px;
  color: var(--red);
  font-weight: 700;
}

.timeline-item h3,
.award-item h3,
.talk-item h3 {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.45;
}

.awards {
  padding: 92px 0;
  background: linear-gradient(135deg, var(--red-deep), var(--red));
  color: #fff;
}

.awards-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 64px;
}

.awards .section-label,
.awards-copy h2,
.awards-copy p,
.award-item time,
.award-item p {
  color: #fff;
}

.awards-copy p,
.award-item p {
  color: rgba(255, 255, 255, 0.76);
}

.award-list {
  grid-template-columns: repeat(2, 1fr);
}

.award-item {
  min-height: 190px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.award-item h3 {
  color: #fff;
}

.photo-rail {
  display: grid;
  grid-template-columns: 1.1fr 1.35fr 0.95fr 1.05fr;
  gap: 14px;
  margin-bottom: 34px;
}

.photo-rail figure {
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--soft);
}

.photo-rail img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.photo-rail figure:nth-child(2) img {
  height: 300px;
}

.photo-rail figure:nth-child(3) img {
  height: 210px;
}

.talk-list {
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.talk-item {
  padding: 24px 22px 22px 0;
  border-bottom: 1px solid var(--line);
}

.talk-item h3 {
  min-height: 52px;
}

.research {
  padding: 96px 0;
  background: var(--paper-strong);
  border-block: 1px solid var(--line);
}

.research-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.76fr) minmax(0, 1.24fr);
  gap: 72px;
  align-items: start;
}

.research-copy {
  position: sticky;
  top: 100px;
}

.research-copy img {
  width: 100%;
  margin-top: 28px;
  border-radius: 6px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.publication-list {
  gap: 0;
  border-top: 1px solid var(--line);
}

.publication {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.publication p {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.8;
}

.contact {
  padding: 72px 0;
  background:
    linear-gradient(90deg, var(--red) 0 10px, transparent 10px),
    var(--paper);
  border-top: 1px solid var(--line);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: 56px;
  align-items: center;
}

.contact-title {
  padding-left: 32px;
}

.contact-title .section-label {
  color: var(--red);
}

.contact-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 18px 28px;
  font-style: normal;
}

.contact-details a,
.contact-details span {
  display: block;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
}

.contact-details a:hover {
  color: var(--red);
}

.contact-details .contact-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 44px;
  padding: 10px 20px;
  color: #fff;
  background: var(--red);
  border: 1px solid var(--red);
  border-radius: 4px;
}

.contact-details .contact-download:hover {
  color: #fff;
  background: var(--red-deep);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

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

  .button:hover {
    transform: none;
  }
}

@media (max-width: 1120px) {
  .nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    background: var(--paper);
  }

  .hero-copy {
    min-height: 560px;
    padding: 112px 32px 42px;
  }

  .hero-media {
    min-height: 440px;
    clip-path: none;
  }

  .hero-media img {
    min-height: 440px;
    object-position: center;
  }

  .profile-grid,
  .awards-grid,
  .research-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .education-panel {
    grid-column: auto;
  }

  .expertise-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .expertise-item:nth-child(2n) {
    border-right: 0;
  }

  .expertise-item:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .timeline,
  .talk-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline::before {
    display: none;
  }

  .timeline-item {
    padding: 22px 20px 24px 30px;
    border-left: 1px solid var(--gold);
  }

  .timeline-item::before {
    top: 27px;
    left: -10px;
  }

  .photo-rail {
    grid-template-columns: repeat(2, 1fr);
  }

  .research-copy {
    position: static;
  }

  .contact-title {
    padding-left: 0;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }

  .site-header {
    min-height: 64px;
    padding: 12px 20px;
  }

  .brand {
    font-size: 15px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .section-inner {
    width: min(100% - 32px, var(--max));
  }

  .hero-copy {
    min-height: auto;
    padding: 104px 20px 36px;
  }

  .hero-title-prefix {
    font-size: 18px;
  }

  h1 {
    font-size: 42px;
  }

  .hero-role {
    font-size: 17px;
  }

  .hero-summary {
    font-size: 15px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-media,
  .hero-media img {
    min-height: 360px;
  }

  .profile,
  .experience,
  .talks,
  .research,
  .awards,
  .expertise {
    padding: 64px 0;
  }

  .profile-grid {
    gap: 34px;
  }

  .profile-copy h2,
  .section-heading h2,
  .awards-copy h2,
  .research-copy h2,
  .contact-title h2 {
    font-size: 29px;
  }

  .section-heading.split {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .expertise-grid,
  .timeline,
  .award-list,
  .talk-list,
  .contact-details {
    grid-template-columns: 1fr;
  }

  .expertise-item,
  .expertise-item:nth-child(2n),
  .expertise-item:last-child {
    min-height: auto;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .expertise-item:first-child {
    border-top: 0;
  }

  .photo-rail {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }

  .photo-rail figure {
    flex: 0 0 76%;
    scroll-snap-align: start;
  }

  .photo-rail img,
  .photo-rail figure:nth-child(2) img,
  .photo-rail figure:nth-child(3) img {
    height: 230px;
  }

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