/* Master of Laws Co., Ltd. — base styles */
:root {
  --navy: #0f1f33;
  --navy-deep: #0a1420;
  --gold: #b8955c;
  --gold-soft: #d4b87a;
  --paper: #f7f5f0;
  --paper-dark: #eae6dd;
  --ink: #1c2430;
  --muted: #5c6570;
  --white: #ffffff;
  --border: rgba(15, 31, 51, 0.12);
  --shadow: 0 12px 40px rgba(15, 31, 51, 0.08);
  --radius: 4px;
  --btn-radius: 12px;
  --btn-shadow: 0 2px 6px rgba(15, 31, 51, 0.08), 0 4px 14px rgba(184, 149, 92, 0.22);
  --btn-shadow-hover: 0 4px 12px rgba(15, 31, 51, 0.1), 0 8px 28px rgba(184, 149, 92, 0.38);
  --font: "IBM Plex Sans Thai", "Segoe UI", system-ui, sans-serif;
  --max: 1120px;
  --page-fade-in: 0.68s;
  --page-fade-out: 0.52s;
  --page-ease-in: cubic-bezier(0.22, 1, 0.36, 1);
  --page-ease-out: cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Cross-page fade (html.pt-transitions set by inline script in <head>) */
html.pt-transitions body {
  opacity: 0;
}

html.pt-transitions body.pt-visible:not(.pt-leaving) {
  opacity: 1;
  transition: opacity var(--page-fade-in) var(--page-ease-in);
}

html.pt-transitions body.pt-leaving {
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--page-fade-out) var(--page-ease-out);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn {
    transition-duration: 0.01ms !important;
  }

  .btn:hover,
  .btn:active {
    transform: none !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--gold);
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 1rem 1.25rem;
  background: var(--navy);
  color: var(--white);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 250, 246, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 22px rgba(10, 20, 32, 0.06);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding: 0.9rem 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.95rem 1.1rem;
  max-width: min(100%, 42rem);
  text-decoration: none;
  color: inherit;
}

.brand:hover {
  color: inherit;
}

.brand__logo {
  height: clamp(3.5rem, 10.5vw, 5.1rem);
  width: auto;
  aspect-ratio: 1;
  object-fit: contain;
  flex-shrink: 0;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.brand__name {
  font-weight: 700;
  font-size: clamp(1.65rem, 3.85vw, 2.3rem);
  letter-spacing: 0.02em;
  color: var(--navy);
  line-height: 1.1;
}

.brand__tag {
  font-size: clamp(0.84rem, 1.9vw, 1.02rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.35;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.05rem;
  flex-wrap: wrap;
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 31, 51, 0.1);
  background: rgba(255, 255, 255, 0.82);
}

.nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.nav a:hover {
  color: var(--navy);
  background: rgba(15, 31, 51, 0.06);
}

.nav a[aria-current="page"] {
  color: var(--navy-deep);
  background: linear-gradient(165deg, #d7ba87 0%, #c7a770 100%);
  border-color: rgba(15, 31, 51, 0.12);
}

/* Hero */
.hero {
  background: linear-gradient(145deg, var(--navy-deep) 0%, var(--navy) 55%, #152a45 100%);
  color: var(--paper);
  padding: clamp(3rem, 8vw, 5.5rem) 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 100% 0%,
    rgba(184, 149, 92, 0.15) 0%,
    transparent 55%
  );
  pointer-events: none;
}

.hero .container {
  position: relative;
  max-width: 1220px;
}

.hero__eyebrow {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold-soft);
  margin: 0 0 1rem;
  font-weight: 600;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 4.9vw, 3.05rem);
  font-weight: 700;
  line-height: 1.15;
  max-width: 18ch;
}

.hero__lead {
  margin: 0 0 1.75rem;
  font-size: 1.1rem;
  max-width: 42ch;
  color: rgba(247, 245, 240, 0.88);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8125rem 1.5rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  border-radius: var(--btn-radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.28s ease,
    color 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease,
    transform 0.22s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 3px;
}

.btn--primary {
  background: linear-gradient(165deg, #cfaf78 0%, var(--gold) 45%, #a67c42 100%);
  color: var(--navy-deep);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: var(--btn-shadow);
}

.btn--primary:hover {
  background: linear-gradient(165deg, #d9bd8a 0%, var(--gold-soft) 48%, #b2884e 100%);
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--navy-deep);
  box-shadow: var(--btn-shadow-hover);
  transform: translateY(-2px);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(15, 31, 51, 0.12), 0 2px 8px rgba(184, 149, 92, 0.25);
  transition-duration: 0.12s;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--paper);
  border-color: rgba(247, 245, 240, 0.38);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--gold-soft);
  color: var(--paper);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}

.btn--ghost:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.1);
  transition-duration: 0.12s;
}

/* Sections */
.section {
  padding: clamp(3rem, 6vw, 4.5rem) 0;
}

.section--alt {
  background: var(--white);
  border-block: 1px solid var(--border);
}

.section__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.65rem, 3.2vw, 2.05rem);
  color: var(--navy);
  font-weight: 700;
}

.section__intro {
  margin: 0 0 2rem;
  color: var(--muted);
  max-width: 58ch;
}

/* Trust grid */
.trust-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.45rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(184, 149, 92, 0.35);
  box-shadow: 0 14px 34px rgba(15, 31, 51, 0.12);
}

.card__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy) 0%, #1e3a5f 100%);
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--navy);
}

.card p {
  margin: 0;
  font-size: 0.95625rem;
  color: var(--muted);
}

/* Service list (home teaser) */
.service-teaser {
  display: grid;
  gap: 1rem;
}

.service-teaser li {
  list-style: none;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.service-teaser ul {
  margin: 0;
  padding: 0;
}

.service-teaser li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.service-teaser__mark {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 0.55rem;
  background: var(--gold);
  border-radius: 1px;
}

.service-teaser h3 {
  margin: 0 0 0.25rem;
  font-size: 1.0625rem;
  color: var(--navy);
}

.service-teaser p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Services page */
.service-block {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.service-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.service-block h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  color: var(--navy);
}

.service-block p,
.service-block ul {
  margin: 0 0 1rem;
  color: var(--muted);
}

.service-block ul {
  padding-left: 1.25rem;
}

.service-block li {
  margin-bottom: 0.35rem;
}

.service-block h2 .service-block__en {
  font-size: clamp(0.81rem, 2.2vw, 0.9rem);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: none;
  line-height: 1.35;
}

.service-subitems {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.service-item h3 {
  margin: 0 0 0.45rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}

.service-item p {
  margin: 0;
  font-size: 0.96875rem;
  color: var(--muted);
  line-height: 1.65;
}

.page-intro__subtitle {
  margin: -0.35rem 0 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-intro__lead {
  margin: 0;
  max-width: 65ch;
  font-size: 1.0625rem;
  color: var(--muted);
  line-height: 1.65;
}

/* Contact */
.contact-layout {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.contact-card h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  color: var(--navy);
}

.contact-row {
  margin-bottom: 1rem;
}

.contact-row:last-child {
  margin-bottom: 0;
}

.contact-row dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.contact-row dd {
  margin: 0;
  font-weight: 500;
}

.contact-row dd + dd {
  margin-top: 0.4rem;
}

.map-embed {
  position: relative;
  aspect-ratio: 16 / 10;
  max-height: 440px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--paper-dark);
}

.map-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.map-embed__intro {
  margin-bottom: 1.25rem;
}

.map-embed__link {
  margin: 1rem 0 0;
  font-size: 0.9375rem;
}

.map-embed__link a {
  font-weight: 600;
}

.form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--navy);
}

.form input,
.form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--font);
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  margin-bottom: 1rem;
}

.form input:focus,
.form textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: transparent;
}

.form textarea {
  min-height: 140px;
  resize: vertical;
}

.form .btn {
  margin-top: 0.25rem;
  width: 100%;
}

.form-note {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 1rem;
}

/* Footer */
.site-footer {
  background: var(--navy-deep);
  color: rgba(247, 245, 240, 0.78);
  padding: 2.25rem 0;
  margin-top: auto;
}

.site-footer__grid {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 768px) {
  .site-footer__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: start;
    gap: 2.5rem;
  }
}

.site-footer__brand-main {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.site-footer__logo {
  height: 3.5rem;
  width: auto;
  aspect-ratio: 1;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.site-footer__brand-text {
  min-width: 0;
}

.site-footer__brand-text p {
  margin: 0 0 0.75rem;
}

.site-footer__brand-text p:last-child {
  margin-bottom: 0;
}

.site-footer__copy {
  font-size: 0.9375rem;
  opacity: 0.88;
}

.site-footer__contact {
  font-style: normal;
  font-size: 0.9375rem;
  line-height: 1.55;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-align: left;
}

.site-footer__contact-line {
  margin: 0;
}

.site-footer__contact-line--meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.55rem;
  row-gap: 0.25rem;
}

.site-footer__contact-line--meta .site-footer__dot {
  opacity: 0.5;
  user-select: none;
}

.site-footer strong {
  color: var(--paper);
  font-weight: 600;
}

.site-footer a {
  color: var(--gold-soft);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.page-intro {
  padding: 2.25rem 0 0;
}

.page-intro h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.65rem, 3.5vw, 2rem);
  color: var(--navy);
}

.page-intro p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.cta-strip {
  background: var(--navy);
  color: var(--paper);
  padding: 2.25rem 0;
  text-align: center;
}

.cta-strip h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.cta-strip p {
  margin: 0 0 1.25rem;
  opacity: 0.9;
}

.cta-strip .btn--primary {
  color: var(--navy-deep);
}

@media (min-width: 980px) {
  .site-header__inner {
    flex-wrap: nowrap;
    gap: 2rem;
    padding: 0.95rem 0;
  }

  .nav {
    margin-left: auto;
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  .nav a {
    font-size: 1rem;
    padding: 0.5rem 1.05rem;
  }
}

@media (max-width: 760px) {
  .site-header__inner {
    padding: 0.8rem 0 0.95rem;
  }

  .brand {
    max-width: 100%;
  }

  .brand__logo {
    height: clamp(3.1rem, 13.5vw, 4.1rem);
  }

  .brand__name {
    font-size: clamp(1.3rem, 6.8vw, 1.85rem);
  }

  .brand__tag {
    font-size: 0.8rem;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
    border-radius: 14px;
  }
}
