/* ==========================================================================
   Uon Vichetr — Corporate Portfolio
   Design tokens
   ========================================================================== */

:root {
  /* Core palette */
  --blue-deep:   #0A2540;   /* Royal blue — primary */
  --blue-mid:    #123A5E;   /* gradient stop */
  --blue-pale:   #E8EDF3;   /* tint for light sections */
  --gold:        #D4AF37;   /* Khmer gold — primary accent */
  --gold-deep:   #A67F22;   /* hover / pressed gold */
  --gold-pale:   #F6EFDC;   /* warm tint */
  --white:       #FFFFFF;
  --ink:         #0B1A2B;   /* near-black, warmed toward blue */
  --ink-soft:    #4E5C6E;   /* secondary text */
  --hairline:    #D9E0E8;

  /* Zone accents (Ecosystem page) */
  --green:       #1F5C42;   /* Adaeng Group */
  --green-pale:  #E9F1EC;
  --warm:        #B9722F;   /* Saosary Foundation */
  --warm-pale:   #FBF0E3;

  /* Type */
  --font-display: "Playfair Display", "Georgia", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --nav-height: 76px;
  --content-max: 1160px;
  --radius: 3px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

/* ==========================================================================
   Reset & base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--blue-deep);
  margin: 0 0 0.5em;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1.2em; max-width: 62ch; color: var(--ink-soft); }

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

button { font-family: inherit; }

.section-max {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

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

/* ==========================================================================
   Geometric divider pattern (Angkor-inspired interlace, used sparingly)
   ========================================================================== */

.kbach-divider {
  height: 34px;
  width: 100%;
  background-repeat: repeat-x;
  background-position: center;
  background-size: 68px 34px;
  opacity: 0.55;
}

.kbach-divider--gold-on-blue {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='68' height='34' viewBox='0 0 68 34'%3E%3Cg fill='none' stroke='%23D4AF37' stroke-width='1'%3E%3Cpath d='M0 17 L17 0 L34 17 L17 34 Z'/%3E%3Cpath d='M34 17 L51 0 L68 17 L51 34 Z'/%3E%3Ccircle cx='17' cy='17' r='3'/%3E%3Ccircle cx='51' cy='17' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

.kbach-divider--blue-on-white {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='68' height='34' viewBox='0 0 68 34'%3E%3Cg fill='none' stroke='%230A2540' stroke-width='1'%3E%3Cpath d='M0 17 L17 0 L34 17 L17 34 Z'/%3E%3Cpath d='M34 17 L51 0 L68 17 L51 34 Z'/%3E%3Ccircle cx='17' cy='17' r='3'/%3E%3Ccircle cx='51' cy='17' r='3'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.14;
}

.pattern-corner {
  position: absolute;
  width: 260px;
  height: 260px;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%23D4AF37' stroke-width='1'%3E%3Cpath d='M0 100 L50 50 L100 100 L50 150 Z'/%3E%3Cpath d='M100 100 L150 50 L200 100 L150 150 Z'/%3E%3Cpath d='M50 50 L100 0 L150 50'/%3E%3Cpath d='M50 150 L100 200 L150 150'/%3E%3Ccircle cx='50' cy='100' r='4'/%3E%3Ccircle cx='150' cy='100' r='4'/%3E%3Ccircle cx='100' cy='100' r='4'/%3E%3C/g%3E%3C/svg%3E");
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.site-nav__inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav__mark {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--blue-deep);
  letter-spacing: 0.01em;
}

.site-nav__mark span {
  color: var(--gold-deep);
}

.site-nav__links {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2.25rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__links a {
  position: relative;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 0.4rem 0.05rem;
  transition: color 0.2s var(--ease);
}

.site-nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--gold);
  transition: right 0.25s var(--ease);
}

.site-nav__links a:hover::after,
.site-nav__links a[aria-current="page"]::after {
  right: 0;
}

.site-nav__links a[aria-current="page"] {
  color: var(--blue-deep);
  font-weight: 600;
}

.site-nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.site-nav__toggle span,
.site-nav__toggle span::before,
.site-nav__toggle span::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background: var(--blue-deep);
  position: relative;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.site-nav__toggle span::before { position: absolute; top: -7px; }
.site-nav__toggle span::after { position: absolute; top: 7px; }

@media (max-width: 760px) {
  .site-nav__toggle { display: block; }
  .site-nav__links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--hairline);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease);
  }
  .site-nav__links.is-open { max-height: 320px; }
  .site-nav__links a { display: block; padding: 1rem clamp(1.25rem, 4vw, 3rem); border-bottom: 1px solid var(--hairline); }
  .site-nav__links a::after { display: none; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, var(--blue-deep) 0%, var(--blue-mid) 62%, #0D2E4C 100%);
  color: var(--white);
  padding: clamp(4.5rem, 10vw, 8rem) 0 clamp(3.5rem, 8vw, 6rem);
}

.hero .pattern-corner { top: -40px; right: -40px; }
.hero .pattern-corner--bl { top: auto; right: auto; bottom: -60px; left: -60px; transform: rotate(20deg); }

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 840px;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin-bottom: 1.75rem;
  letter-spacing: 0.02em;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2.5rem, 4.4vw + 1rem, 4.25rem);
  max-width: 15ch;
}

.hero__sub {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: rgba(255, 255, 255, 0.82);
  max-width: 46ch;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(212, 175, 55, 0.35);
}

.hero__sub strong { color: var(--white); font-weight: 600; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn--gold {
  background: var(--gold);
  color: var(--blue-deep);
}
.btn--gold:hover { background: var(--gold-deep); }

.btn--outline {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--white);
}
.btn--outline:hover { border-color: var(--gold); color: var(--gold); }

.btn--dark-outline {
  border-color: var(--blue-deep);
  color: var(--blue-deep);
}
.btn--dark-outline:hover { background: var(--blue-deep); color: var(--white); }

/* ==========================================================================
   Section rhythm
   ========================================================================== */

.section {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}

.section--tint {
  background: var(--blue-pale);
}

.section__head {
  max-width: 640px;
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
}

.section__head h2 {
  font-size: clamp(1.9rem, 2.6vw + 1rem, 2.75rem);
}

/* ==========================================================================
   Ecosystem cards (homepage teaser)
   ========================================================================== */

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 860px) {
  .pillar-grid { grid-template-columns: 1fr; }
}

.pillar-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--blue-deep);
  padding: 2.25rem 1.9rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px -20px rgba(10, 37, 64, 0.35);
}

.pillar-card--green { border-top-color: var(--green); }
.pillar-card--warm { border-top-color: var(--warm); }

.pillar-card__label {
  font-size: 0.8rem;
  color: var(--gold-deep);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.pillar-card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.7rem;
}

.pillar-card p {
  font-size: 0.96rem;
  margin-bottom: 1.3rem;
}

.pillar-card__link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue-deep);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
}

/* ==========================================================================
   Fade-in on scroll
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

/* ==========================================================================
   Biography page
   ========================================================================== */

.bio-header {
  text-align: center;
  margin-bottom: clamp(2.5rem, 6vw, 3.5rem);
}

.bio-header__photo {
  border-radius: 50%;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 1px var(--hairline), 0 18px 30px -18px rgba(10, 37, 64, 0.4);
  margin-bottom: 1.5rem;
}

.bio-header h1 {
  font-size: clamp(2rem, 2.8vw + 1rem, 2.75rem);
  margin-bottom: 0.3rem;
}

.bio-header .role {
  color: var(--gold-deep);
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
}

.bio-copy--centered {
  max-width: 68ch;
  margin: 0 auto;
}

.bio-copy--centered p {
  max-width: none;
}

.bio-copy h1 {
  font-size: clamp(2.1rem, 3vw + 1rem, 3rem);
  margin-bottom: 0.3rem;
}

.bio-copy .role {
  color: var(--gold-deep);
  font-weight: 600;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.bio-copy p {
  max-width: 68ch;
  font-size: 1.02rem;
  color: var(--ink);
}

.bio-copy p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.2rem;
  float: left;
  line-height: 0.85;
  padding-right: 0.5rem;
  padding-top: 0.3rem;
  color: var(--blue-deep);
}

/* ==========================================================================
   Ecosystem page — zones
   ========================================================================== */

.zone {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6rem) 0;
}

.zone--blue { background: var(--blue-deep); color: var(--white); }
.zone--blue h2, .zone--blue h3 { color: var(--white); }
.zone--blue p { color: rgba(255, 255, 255, 0.78); }

.zone--green { background: var(--green-pale); }
.zone--green h2 { color: var(--green); }

.zone--warm { background: var(--warm-pale); }
.zone--warm h2 { color: var(--warm); }

.zone__eyebrow {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
  display: block;
}

.zone--blue .zone__eyebrow { color: var(--gold); }
.zone--green .zone__eyebrow { color: var(--green); }
.zone--warm .zone__eyebrow { color: var(--warm); }

.zone__intro {
  max-width: 700px;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.zone__intro h2 {
  font-size: clamp(1.9rem, 2.8vw + 1rem, 2.75rem);
}

.zone__intro p {
  font-size: 1.06rem;
}

.entity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 860px) {
  .entity-grid { grid-template-columns: 1fr; }
}

.entity-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 1.75rem;
}

.zone--green .entity-card,
.zone--warm .entity-card {
  background: var(--white);
  border: 1px solid rgba(10, 37, 64, 0.08);
}

.entity-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.zone--blue .entity-card h3 { color: var(--white); }
.zone--green .entity-card h3 { color: var(--green); }
.zone--warm .entity-card h3 { color: var(--warm); }

.entity-card p {
  font-size: 0.94rem;
  margin-bottom: 0;
}

.zone--blue .entity-card p { color: rgba(255,255,255,0.75); }

.entity-card__link {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  border-bottom: 1px solid var(--green);
  padding-bottom: 2px;
}

.zone--blue .entity-card__link { color: var(--gold); border-bottom-color: var(--gold); }
.zone--warm .entity-card__link { color: var(--warm); border-bottom-color: var(--warm); }

/* Single-entity zone (Saosary) layout */
.zone__single {
  max-width: 760px;
}

/* ==========================================================================
   Contact page
   ========================================================================== */

.contact-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2.5rem, 6vw, 4.5rem);
}

@media (max-width: 820px) {
  .contact-layout { grid-template-columns: 1fr; }
}

.contact-info h1 {
  font-size: clamp(2.1rem, 3vw + 1rem, 3rem);
}

.contact-info__item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--hairline);
}

.contact-info__item:last-child { border-bottom: 1px solid var(--hairline); }

.contact-info__label {
  font-size: 0.8rem;
  color: var(--gold-deep);
  font-weight: 600;
}

.contact-info__value {
  font-size: 1.05rem;
  color: var(--blue-deep);
  font-weight: 600;
}

.contact-info__value a:hover { color: var(--gold-deep); }

.form-field {
  margin-bottom: 1.3rem;
}

.form-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue-deep);
  margin-bottom: 0.4rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
  outline: none;
}

.form-field textarea { resize: vertical; min-height: 140px; }

.contact-form__status {
  margin-top: 1rem;
  font-size: 0.92rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  display: none;
}

.contact-form__status.is-visible { display: block; }

.contact-form__status.success {
  background: var(--green-pale);
  color: var(--green);
  border: 1px solid rgba(31, 92, 66, 0.25);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--blue-deep);
  color: rgba(255, 255, 255, 0.7);
  padding: clamp(2.5rem, 5vw, 3.5rem) 0 2rem;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.site-footer__mark {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.1rem;
}

.site-footer__mark span { color: var(--gold); }

.site-footer__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.site-footer__links a:hover { color: var(--gold); }

.site-footer__legal {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
