/* Choi Gan - custom styles (plain CSS; works alongside the Tailwind CDN) */

:root {
  --jade: #2F6B4F;
  --jade-dark: #245840;
  --jade-light: #E3EEE7;
  --lacquer: #C0392B;
  --lacquer-dark: #A02F23;
  --ink: #1E2A24;
  --rice: #FAF6EE;
  --gold: #B8975A;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; outline: 3px solid var(--gold); outline-offset: 2px; }

#main:focus { outline: none; }

/* Hero */
.hero {
  background:
    radial-gradient(ellipse at 85% 15%, rgba(184, 151, 90, 0.28), transparent 55%),
    radial-gradient(ellipse at 10% 90%, rgba(192, 57, 43, 0.22), transparent 50%),
    linear-gradient(135deg, var(--ink) 0%, #23402F 45%, var(--jade) 100%);
}
.lattice {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23FAF6EE' stroke-width='1.5'%3E%3Cpath d='M0 14h14V0M42 0v14h14M56 42H42v14M14 56V42H0'/%3E%3Crect x='20' y='20' width='16' height='16'/%3E%3Cpath d='M28 0v20M28 36v20M0 28h20M36 28h20'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 56px;
}

/* Buttons */
.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.75rem;
  border-radius: 9999px;
  font-weight: 700;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-primary { background: var(--lacquer); color: #fff; }
.btn-primary:hover { background: var(--lacquer-dark); }
.btn-outline { border: 2px solid rgba(255, 255, 255, 0.75); color: #fff; }
.btn-outline:hover { background: #fff; color: var(--jade); border-color: #fff; }
.btn-primary:focus-visible,
.btn-outline:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* Navigation */
.nav-link {
  color: var(--ink);
  border-radius: 0.25rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav-link:hover { color: var(--jade); border-bottom-color: var(--lacquer); }
.nav-link:focus-visible { outline: 2px solid var(--jade); outline-offset: 4px; }

.mobile-link {
  display: block;
  padding: 0.85rem 0.5rem;
  border-radius: 0.5rem;
  color: var(--ink);
}
.mobile-link:hover { background: var(--jade-light); color: var(--jade); }
.mobile-link:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }

/* Section headings */
.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lacquer);
}
.section-title {
  margin-top: 0.75rem;
  font-family: "Noto Serif TC", Georgia, serif;
  font-weight: 700;
  font-size: 1.875rem;
  line-height: 1.2;
  color: var(--ink);
}
@media (min-width: 640px) { .section-title { font-size: 2.25rem; } }

/* Cards */
.card {
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  border-radius: 1rem;
  background: var(--rice);
  border: 1px solid rgba(30, 42, 36, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px -12px rgba(30, 42, 36, 0.25); }
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.85rem;
  background: var(--jade);
  color: #fff;
}
.card-title {
  margin-top: 1.25rem;
  font-family: "Noto Serif TC", Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
}
.card-text { margin-top: 0.6rem; line-height: 1.65; color: rgba(30, 42, 36, 0.82); }

/* Key facts */
.fact {
  padding: 1.5rem;
  border-radius: 1rem;
  background: #fff;
  border-top: 4px solid var(--gold);
  box-shadow: 0 1px 2px rgba(30, 42, 36, 0.06);
}
.fact-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jade);
}
.fact-value {
  margin-top: 0.5rem;
  font-family: "Noto Serif TC", Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--ink);
}

/* Links on dark backgrounds */
.dark-link {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
  width: fit-content;
}
.dark-link:hover { color: var(--gold); }
.dark-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

button.footer-link,
a.footer-link {
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}
button.footer-link:hover,
a.footer-link:hover { color: #fff; text-decoration-color: var(--gold); }
button.footer-link:focus-visible,
a.footer-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

/* Legal dialogs */
dialog.legal-dialog {
  width: min(44rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 1rem;
  background: var(--rice);
  color: var(--ink);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45);
}
dialog.legal-dialog::backdrop { background: rgba(22, 32, 27, 0.7); }
.legal-inner { display: flex; flex-direction: column; max-height: calc(100vh - 2rem); }
.legal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(30, 42, 36, 0.12);
}
button.legal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
button.legal-close:hover { background: var(--jade-light); }
button.legal-close:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
.legal-body {
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1.75rem;
  line-height: 1.65;
  color: rgba(30, 42, 36, 0.88);
}
.legal-body h3 {
  margin-top: 1.4rem;
  font-family: "Noto Serif TC", Georgia, serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.legal-body p { margin-top: 0.5rem; }
.legal-body ul { margin-top: 0.5rem; padding-left: 1.25rem; list-style: disc; }
.legal-body li { margin-top: 0.35rem; }
@media (min-width: 640px) {
  .legal-head { padding: 1.5rem 2rem; }
  .legal-body { padding: 1.5rem 2rem 2rem; }
}

body.dialog-open { overflow: hidden; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover { transform: none; }
}
