/* ==========================================================================
   mynt.sg — design system
   Single source of truth for design tokens. Fonts self-hosted (assets/fonts).
   Headings: League Spartan. Body: Mulish (Avenir-like).
   ========================================================================== */

/* ---- Fonts (League Spartan headings, Mulish body) -------------------------- */
/* Served from Google Fonts. Can be swapped to self-hosted woff2 under
   assets/fonts/ later without touching anything but this import. */
@import url("https://fonts.googleapis.com/css2?family=League+Spartan:wght@400;600;700&family=Mulish:wght@300;400;600;700&display=swap");

/* ---- Design tokens -------------------------------------------------------- */
:root {
  /* Brand colors (sampled from live site DOM) */
  --navy: #041E42;          /* headings, body text, dark sections */
  --navy-80: rgba(4, 30, 66, 0.8);
  --navy-60: rgba(4, 30, 66, 0.6);
  --bg: #FFFDFB;            /* warm white page background */
  --blue-grey: #DDE5ED;    /* light section background */
  --grey: #C0C5CD;         /* muted */
  --accent: #14C386;       /* origami-logo green (brand fills/decoration) */
  --accent-dark: #0EA56F;  /* button hover */
  --accent-strong: #0C7A50;/* readable green for text links (AA on white) */
  --white: #FFFFFF;
  --line: rgba(4, 30, 66, 0.12);

  /* Semantic */
  --color-text: var(--navy);
  --color-bg: var(--bg);
  --color-heading: var(--navy);
  --color-link: var(--accent-strong);
  --color-border: var(--line);

  /* Typography */
  --font-head: "League Spartan", system-ui, sans-serif;
  --font-body: "Mulish", system-ui, -apple-system, sans-serif;

  --fs-hero: clamp(2.5rem, 6vw, 3.5rem);     /* ~56px */
  --fs-h2: clamp(1.9rem, 4vw, 2.375rem);     /* ~38px */
  --fs-h3: clamp(1.3rem, 2.5vw, 1.6rem);
  --fs-body: 1.125rem;                        /* 18px */
  --fs-small: 0.9375rem;                      /* 15px */
  --lh-body: 1.7;
  --lh-tight: 1.15;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-24: 6rem;

  /* Layout */
  --container: 1120px;
  --container-narrow: 760px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(4, 30, 66, 0.08);
  --shadow-lg: 0 18px 50px rgba(4, 30, 66, 0.12);

  /* Motion (Disney easing tokens) */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Reset / base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, svg { display: block; max-width: 100%; }
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.25rem; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 400;
  color: var(--color-heading);
  line-height: var(--lh-tight);
  letter-spacing: 0.01em;
}
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

/* ---- Layout helpers ------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-6); }
.container--narrow { max-width: var(--container-narrow); }
.section { padding-block: var(--sp-24); }
.section--tight { padding-block: var(--sp-16); }
.center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Buttons / links ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--font-head); font-size: 1rem; font-weight: 600; letter-spacing: 0.03em;
  padding: 0.85em 1.6em; border-radius: 999px; border: 1.5px solid var(--accent);
  background: var(--accent); color: var(--navy); cursor: pointer;
  transition: transform 120ms var(--ease-out), background 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--navy); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent); color: var(--white); }

.link-more {
  font-family: var(--font-head); font-weight: 600; letter-spacing: 0.04em;
  font-size: 0.95rem; color: var(--accent-strong); display: inline-flex; align-items: center; gap: 0.35em;
}
.link-more::after { content: "\2192"; transition: transform 150ms var(--ease-out); }
.link-more:hover { text-decoration: none; }
.link-more:hover::after { transform: translateX(3px); }
.tag-soon {
  font-family: var(--font-head); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  font-size: 0.8rem; color: var(--grey);
}

/* ---- Header --------------------------------------------------------------- */
.site-header { position: relative; z-index: 10; }
.site-header__inner {
  max-width: var(--container); margin-inline: auto; padding: var(--sp-6) var(--sp-6) 0;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
}
.site-header--home .site-header__inner { justify-content: center; padding-bottom: var(--sp-2); }
.site-logo { display: inline-flex; align-items: center; }
.site-logo img, .site-logo svg { width: 64px; height: 64px; }
.site-nav { display: flex; gap: var(--sp-8); }
.site-nav a {
  font-family: var(--font-head); font-weight: 600; letter-spacing: 0.04em;
  color: var(--navy); font-size: 1.05rem;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

/* ---- Torn-paper edge ------------------------------------------------------ */
/* The hero photo is masked top & bottom with a torn-paper edge filled in page bg. */
.torn-edge {
  position: absolute; left: 0; right: 0; width: 100%; height: 40px; z-index: 2;
  color: var(--bg); /* fill inherits via currentColor in the SVG use */
  pointer-events: none;
}
.torn-edge svg { width: 100%; height: 100%; display: block; }
.torn-edge--top { top: -1px; }
.torn-edge--bottom { bottom: -1px; transform: scaleY(-1); }

/* ---- Hero ----------------------------------------------------------------- */
.hero { position: relative; width: 100%; overflow: hidden; }
.hero__media { position: relative; width: 100%; aspect-ratio: 16 / 7; min-height: 320px; max-height: 70vh; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }

/* Branded placeholder — shows until a real photo is dropped at the image's path.
   When the real <img> loads it covers this background; if the file is missing,
   img-fallback.js hides the broken <img> so this placeholder shows through. */
.hero__media, .card__media, .post-card__media, .article__feature {
  background-color: var(--blue-grey);
  /* Drop a photo at /assets/placeholder.jpg to use it everywhere; until it exists
     that layer simply doesn't paint and the branded SVG placeholder shows instead. */
  background-image: url("/assets/placeholder.jpg"), url("/assets/placeholder.svg");
  background-position: center, center;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
}
.article__feature { aspect-ratio: 16 / 9; }
.article__feature img { width: 100%; height: 100%; object-fit: cover; }

/* ---- About ---------------------------------------------------------------- */
.about { text-align: center; }
.about h2 { font-size: var(--fs-hero); margin-bottom: var(--sp-8); }
.about p { max-width: var(--container-narrow); margin-inline: auto; color: var(--navy-80); }
.about p + p { margin-top: var(--sp-6); }

/* ---- Services grid -------------------------------------------------------- */
.services { background: var(--blue-grey); }
.services__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-8);
}
.services__grid > * { min-width: 0; } /* prevent grid blowout from wide content */
.card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card__media { aspect-ratio: 1 / 1; background-color: var(--blue-grey); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
.card__title { font-family: var(--font-head); font-size: 1.4rem; line-height: 1.15; color: var(--navy); }
.card__title small { display: block; font-size: 1rem; color: var(--navy-60); font-weight: 400; }
.card__foot { margin-top: auto; padding-top: var(--sp-2); }
.card.is-soon { opacity: 0.85; }

/* ---- Contact -------------------------------------------------------------- */
.contact { background: var(--navy); color: var(--bg); }
.contact h2 { color: var(--bg); text-align: center; margin-bottom: var(--sp-8); }
.form { max-width: var(--container-narrow); margin-inline: auto; display: grid; gap: var(--sp-4); }
.form__row { display: grid; gap: var(--sp-2); }
.form label { font-family: var(--font-head); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.03em; color: var(--bg); }
.form input, .form select, .form textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--navy);
  background: var(--bg); border: 1.5px solid transparent; border-radius: var(--radius-sm);
  padding: 0.8em 1em; width: 100%;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 164, 99, 0.25);
}
.form textarea { min-height: 140px; resize: vertical; }
.form__honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__actions { display: flex; justify-content: center; margin-top: var(--sp-2); }
.form__status { text-align: center; min-height: 1.5em; font-size: 0.95rem; }
.form__status.is-error { color: #ffb4b4; }
.form__status.is-ok { color: #b9f0cf; }

/* ---- Footer --------------------------------------------------------------- */
.site-footer {
  background: var(--navy); color: var(--bg); text-align: center;
  padding-block: var(--sp-8); font-size: var(--fs-small);
}
.site-footer a { color: var(--bg); }
.site-footer__inner { display: flex; gap: var(--sp-3); justify-content: center; align-items: center; flex-wrap: wrap; }

/* ---- Blog index ----------------------------------------------------------- */
.blog-head { text-align: left; padding-top: var(--sp-12); }
.blog-head h1 { font-size: var(--fs-hero); }
.posts { display: grid; gap: var(--sp-8); margin-top: var(--sp-8); }
.post-card {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--sp-8); align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white);
  transition: box-shadow 180ms var(--ease-out);
}
.post-card:hover { box-shadow: var(--shadow); }
.post-card > * { min-width: 0; } /* prevent grid blowout from wide content */
.post-card__media { aspect-ratio: 16 / 10; background-color: var(--blue-grey); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
/* In the 2-col layout the media fills the card height; drop aspect-ratio so it
   doesn't derive its width from the stretched height and overflow the column. */
@media (min-width: 901px) {
  .post-card__media { aspect-ratio: auto; align-self: stretch; height: 100%; }
}
.post-card__body { padding: var(--sp-8); display: flex; flex-direction: column; gap: var(--sp-3); }
.post-card__title { font-family: var(--font-head); font-size: 1.6rem; line-height: 1.15; color: var(--navy); }
.post-card__title a { color: inherit; }
.post-card__title a:hover { color: var(--accent); text-decoration: none; }
.post-card__excerpt { color: var(--navy-80); }
.post-meta { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-small); color: var(--navy-60); margin-top: auto; }
.post-meta__avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-grey); display: grid; place-items: center; }
.post-meta__avatar img { width: 20px; height: 20px; }

/* ---- Article (single post) ------------------------------------------------ */
.article { padding-block: var(--sp-12) var(--sp-16); }
.article__head { max-width: var(--container-narrow); margin-inline: auto; }
.article__meta { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-small); color: var(--navy-60); margin-bottom: var(--sp-6); }
.article h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: var(--sp-8); }
.article__feature { max-width: var(--container); margin: var(--sp-8) auto; border-radius: var(--radius); overflow: hidden; }
.article__body { max-width: var(--container-narrow); margin-inline: auto; }
.article__body > * + * { margin-top: var(--sp-6); }
.article__body h2 { font-size: var(--fs-h2); margin-top: var(--sp-12); }
.article__body h3 { font-size: var(--fs-h3); margin-top: var(--sp-8); }
.article__body p, .article__body li { color: var(--navy-80); }
.article__body ul, .article__body ol { display: grid; gap: var(--sp-2); }
.article__body blockquote {
  border-left: 4px solid var(--accent); background: var(--blue-grey);
  padding: var(--sp-4) var(--sp-6); border-radius: var(--radius-sm); color: var(--navy);
  font-style: normal;
}
.article__body table {
  width: 100%; border-collapse: collapse; font-size: var(--fs-small);
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
}
.article__body th, .article__body td { padding: var(--sp-3) var(--sp-4); text-align: left; border-bottom: 1px solid var(--line); }
.article__body th { background: var(--blue-grey); font-family: var(--font-head); font-weight: 600; }
.article__body img { border-radius: var(--radius-sm); margin-inline: auto; }
.faq h3 { font-size: 1.15rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.4em; font-family: var(--font-head); font-weight: 600; }

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .post-card { grid-template-columns: 1fr; }
  .post-card__media { aspect-ratio: 16 / 9; }
}
@media (max-width: 600px) {
  :root { --fs-body: 1.0625rem; }
  .section { padding-block: var(--sp-16); }
  .services__grid { grid-template-columns: 1fr; }
  .site-header__inner { padding-inline: var(--sp-4); }
  .container { padding-inline: var(--sp-4); }
  .site-nav { gap: var(--sp-4); }
  .post-card__body, .card__body { padding: var(--sp-6); }
}

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