/* ==========================================================
   Tanyag v2 — shared design system
   Same brand as v1 (logo, rust + leaf, Quicksand + Nunito Sans),
   rebuilt for a premium, cinematic scroll experience.
   ========================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Brand palette (names are Hiligaynon) */
  --rust: #B84F28;        /* Tanyag Rust */
  --rust-deep: #8E3A1B;
  --leaf: #4E7A16;        /* Uma (farm field) Green */
  --leaf-bright: #8DB84A;
  --sea: #2F7C84;         /* Dagat (sea) Teal */
  --sun: #E9A23B;         /* Adlaw (sun) Gold */
  --gatas: #FBF6EE;       /* Gatas (milk) Cream */
  --baybay: #EFE4D4;      /* Baybay (shore) Sand */
  --gabi: #1A120D;        /* Gab-i (night) Ink */

  /* Theme roles (light) */
  --bg: var(--gatas);
  --bg-2: var(--baybay);
  --fg: var(--gabi);
  --fg-2: #5E4F45;
  --line: rgba(26, 18, 13, .14);
  --accent: var(--rust);
  --accent-2: var(--leaf);
  --invert-bg: var(--gabi);
  --invert-fg: var(--gatas);

  --font-display: "Quicksand", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 64px);
  --radius: 22px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.77, 0, .18, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #120C09;
  --bg-2: #1C140F;
  --fg: #F4EADF;
  --fg-2: #BFAE9F;
  --line: rgba(244, 234, 223, .14);
  --accent: #E8845A;
  --accent-2: #A6CB6A;
  --invert-bg: var(--gatas);
  --invert-fg: var(--gabi);
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: clamp(1rem, .95rem + .25vw, 1.15rem); line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color .5s var(--ease-out), color .5s var(--ease-out);
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0; line-height: 1; letter-spacing: -.035em; }
p { margin: 0 0 1em; }
::selection { background: var(--rust); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.skip { position: fixed; left: -999px; top: 12px; z-index: 1000; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 999px; }
.skip:focus { left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type scale ---------- */
.t-mega { font-size: clamp(4.5rem, 19vw, 20rem); line-height: .82; letter-spacing: -.055em; }
.t-display { font-size: clamp(3rem, 9vw, 9.5rem); line-height: .9; letter-spacing: -.05em; }
.t-h1 { font-size: clamp(2.5rem, 6vw, 6rem); line-height: .95; }
.t-h2 { font-size: clamp(2rem, 4.2vw, 4.2rem); line-height: 1; }
.t-h3 { font-size: clamp(1.4rem, 2vw, 2rem); line-height: 1.1; letter-spacing: -.02em; }
.t-lead { font-size: clamp(1.15rem, 1rem + .8vw, 1.6rem); line-height: 1.45; color: var(--fg-2); max-width: 38ch; }
.t-label {
  font-family: var(--font-body); font-weight: 700; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: .8em;
}
.t-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.t-index { font-family: var(--font-display); font-weight: 600; font-size: .95rem; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.accent { color: var(--accent); }
.italic-note { font-style: italic; color: var(--fg-2); }

/* ---------- Layout ---------- */
.wrap { padding-inline: var(--gutter); max-width: 1680px; margin-inline: auto; }
.section { padding-block: clamp(96px, 16vh, 200px); position: relative; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(12px, 2vw, 32px); }

/* ---------- Grain overlay (subtle film texture) ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 900; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
  will-change: transform; /* keeps the moving texture on its own layer (no full-page repaints) */
}
:root[data-theme="dark"] .grain { opacity: .09; }
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-5%, 3%); } 40% { transform: translate(4%, -6%); }
  60% { transform: translate(-3%, 5%); } 80% { transform: translate(6%, 2%); } 100% { transform: translate(0, 0); }
}

/* ---------- Header ---------- */
.hdr {
  position: fixed; inset: 0 0 auto; z-index: 500; display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter); mix-blend-mode: normal; transition: transform .6s var(--ease-out);
}
.hdr.is-hidden { transform: translateY(-110%); }
.logo { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; letter-spacing: -.02em; }
.logo img { width: 30px; }
:root[data-theme="dark"] .logo img { filter: brightness(0) invert(1) sepia(.2); }
.hdr__right { display: flex; align-items: center; gap: 10px; }
.chip-btn {
  height: 48px; min-width: 48px; padding: 0 20px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); font-weight: 700; font-size: .95rem;
}
.chip-btn--icon { padding: 0; width: 48px; }
.chip-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
.menu-btn__lines { width: 18px; height: 10px; position: relative; }
.menu-btn__lines::before, .menu-btn__lines::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 2px; transition: transform .5s var(--ease-out), top .5s var(--ease-out); }
.menu-btn__lines::before { top: 0; }
.menu-btn__lines::after { top: 8px; }
.menu-open .menu-btn__lines::before { top: 4px; transform: rotate(45deg); }
.menu-open .menu-btn__lines::after { top: 4px; transform: rotate(-45deg); }

/* ---------- Full-screen menu ---------- */
.menu {
  position: fixed; inset: 0; z-index: 450; background: var(--rust); color: #fff;
  clip-path: inset(0 0 100% 0); visibility: hidden;
  display: grid; grid-template-rows: 1fr auto; padding: 110px var(--gutter) 32px;
}
.menu__list { list-style: none; margin: 0; padding: 0; align-self: center; }
.menu__list li { overflow: hidden; }
.menu__list a {
  display: flex; align-items: baseline; gap: 20px; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.8rem, 8.5vw, 7.5rem); line-height: 1.02; letter-spacing: -.05em; transition: color .3s, padding-left .5s var(--ease-out);
}
.menu__list a span { font-size: .9rem; letter-spacing: .1em; font-weight: 600; opacity: .7; font-family: var(--font-body); }
.menu__list a:hover, .menu__list a[aria-current="page"] { color: var(--gabi); padding-left: 24px; }
.menu__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-weight: 600; opacity: .9; }
.menu__foot a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Buttons ---------- */
.btn {
  --b-bg: var(--fg); --b-fg: var(--bg);
  position: relative; display: inline-flex; align-items: center; gap: 14px; height: 60px; padding: 0 12px 0 28px;
  border-radius: 999px; background: var(--b-bg); color: var(--b-fg); font-weight: 700; font-size: 1rem; overflow: hidden; isolation: isolate;
}
.btn::before { /* fill that rises on hover */
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--rust); border-radius: inherit;
  transform: translateY(101%); transition: transform .6s var(--ease-out);
}
.btn:hover::before { transform: translateY(0); }
.btn:hover { color: #fff; }
.btn--rust { --b-bg: var(--rust); --b-fg: #fff; }
.btn--rust::before { background: var(--gabi); }
.btn--ghost { --b-bg: transparent; --b-fg: var(--fg); box-shadow: inset 0 0 0 1.5px var(--fg); }
.btn__text { position: relative; display: block; overflow: hidden; height: 1.3em; line-height: 1.3em; }
.btn__text span { display: block; transition: transform .6s var(--ease-out); }
.btn__text span + span { position: absolute; inset: 100% 0 auto; }
.btn:hover .btn__text span { transform: translateY(-100%); }
.btn__icon {
  width: 38px; height: 38px; border-radius: 50%; background: var(--b-fg); color: var(--b-bg); display: grid; place-items: center; flex: none;
  transition: transform .6s var(--ease-out), background-color .3s, color .3s;
}
.btn--ghost .btn__icon { background: var(--fg); color: var(--bg); }
.btn:hover .btn__icon { transform: rotate(-45deg); background: #fff; color: var(--rust); }
.btn__icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.link-u { position: relative; font-weight: 700; display: inline-block; }
.link-u::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px; background: currentColor; transform: scaleX(1); transform-origin: right; transition: transform .6s var(--ease-out); }
.link-u:hover::after { animation: underline .9s var(--ease-out); }
@keyframes underline { 0% { transform: scaleX(1); transform-origin: right; } 45% { transform: scaleX(0); transform-origin: right; } 46% { transform-origin: left; } 100% { transform: scaleX(1); transform-origin: left; } }

.circle-btn {
  width: clamp(120px, 12vw, 170px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; text-align: center;
  background: var(--rust); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.15;
  transition: transform .6s var(--ease-out);
}
.circle-btn:hover { transform: scale(1.06); }

/* ---------- Photo placeholder (until real photos arrive) ---------- */
.ph {
  position: relative; overflow: hidden; border-radius: var(--radius); background: var(--bg-2);
  --c1: #D98B55; --c2: #B84F28; --c3: #5B2412;
}
.ph__img {
  position: absolute; inset: -12% 0; /* extra room for parallax */
  background:
    radial-gradient(120% 80% at 80% 10%, rgba(255, 220, 160, .55), transparent 55%),
    radial-gradient(90% 70% at 10% 100%, var(--c3), transparent 70%),
    linear-gradient(160deg, var(--c1), var(--c2));
}
.ph__img::after { /* soft horizon line so it reads like a landscape */
  content: ""; position: absolute; left: 0; right: 0; top: 58%; height: 42%;
  background: linear-gradient(180deg, rgba(0, 0, 0, .0), rgba(0, 0, 0, .28));
}
.ph__tag {
  position: absolute; left: 16px; bottom: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  background: rgba(20, 12, 8, .55); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 8px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .04em;
}
.ph__tag svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.ph--sea { --c1: #6FB3B8; --c2: #2F7C84; --c3: #0F3A40; }
.ph--leaf { --c1: #A9C878; --c2: #4E7A16; --c3: #1E330A; }
.ph--sun { --c1: #F2C46B; --c2: #D98A2B; --c3: #6B3A0C; }
.ph--dusk { --c1: #C98AA0; --c2: #6E4A7A; --c3: #221633; }

/* ---------- Cursor ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; }
.cursor__dot {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--rust);
  transition: width .4s var(--ease-out), height .4s var(--ease-out), margin .4s var(--ease-out), background-color .3s;
  display: grid; place-items: center;
}
.cursor__label { font-size: .8rem; font-weight: 800; color: #fff; opacity: 0; transition: opacity .3s; letter-spacing: .04em; white-space: nowrap; }
.cursor.is-link .cursor__dot { width: 46px; height: 46px; margin: -23px 0 0 -23px; background: color-mix(in srgb, var(--rust) 25%, transparent); }
.cursor.is-label .cursor__dot { width: 96px; height: 96px; margin: -48px 0 0 -48px; background: var(--rust); }
.cursor.is-label .cursor__label { opacity: 1; }
.cursor.is-hidden .cursor__dot { width: 0; height: 0; margin: 0; }
/* Over orange/rust backgrounds the cursor turns white so it stays visible */
.cursor.on-orange .cursor__dot { background: #fff; }
.cursor.on-orange.is-link .cursor__dot { background: rgba(255, 255, 255, .3); }
.cursor.on-orange.is-label .cursor__dot { background: #fff; }
.cursor.on-orange .cursor__label { color: var(--rust); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }
@media (hover: hover) and (pointer: fine) {
  /* the custom cursor replaces the system arrow everywhere, so it never flips back to the default arrow */
  .has-cursor, .has-cursor * { cursor: none !important; }
  .has-cursor input, .has-cursor textarea { cursor: text !important; }
}

/* ---------- Page transition + preloader ---------- */
.curtain {
  position: fixed; inset: 0; z-index: 800; background: var(--rust); display: grid; place-items: center;
  pointer-events: none; visibility: hidden;
}
.curtain__logo { width: clamp(70px, 9vw, 120px); filter: brightness(0) invert(1); }
.loader {
  position: fixed; inset: 0; z-index: 850; background: var(--gabi); color: var(--gatas);
  display: grid; place-items: center; overflow: hidden;
}
.loader__mark { position: relative; width: clamp(90px, 12vw, 150px); aspect-ratio: 240 / 258; }
.loader__mark img { position: absolute; inset: 0; width: 100%; height: 100%; filter: brightness(0) invert(1); opacity: .12; }
.loader__mark img + img { filter: none; opacity: 1; clip-path: inset(100% 0 0 0); }
.loader__count { position: absolute; right: var(--gutter); bottom: 24px; font-family: var(--font-display); font-weight: 700; font-size: clamp(3.5rem, 12vw, 10rem); line-height: .8; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.loader__word { position: absolute; left: var(--gutter); bottom: 32px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; font-size: .78rem; opacity: .7; }
.no-js .loader, .no-js .curtain { display: none; }

/* ---------- Split-text helpers (used by GSAP SplitText) ---------- */
.split-line { overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
[data-split] { visibility: hidden; }
.is-ready [data-split], .no-js [data-split] { visibility: visible; }

/* ---------- Footer ---------- */
.ftr { background: var(--gabi); color: var(--gatas); padding: clamp(80px, 12vw, 160px) 0 28px; overflow: hidden; }
.ftr__cta { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 40px; }
.ftr__big { font-size: clamp(3.2rem, 11vw, 12rem); line-height: .85; letter-spacing: -.055em; }
.ftr__big em { font-style: normal; color: #E8845A; }
.ftr__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: clamp(60px, 10vw, 120px); padding-top: 28px; border-top: 1px solid rgba(251, 246, 238, .15); }
.ftr__grid h4 { font-family: var(--font-body); font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; opacity: .55; margin-bottom: 14px; }
.ftr__grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ftr__grid a:hover { color: #E8845A; }
.ftr__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 48px; font-size: .85rem; opacity: .55; }
.ftr__word { font-family: var(--font-display); font-weight: 700; font-size: 25.5vw; line-height: .75; letter-spacing: -.06em; color: #E8845A; opacity: .12; margin: 40px 0 -3vw; white-space: nowrap; text-align: center; }

@media (max-width: 800px) {
  .ftr__grid { grid-template-columns: 1fr 1fr; }
  .hdr { padding-top: 16px; padding-bottom: 16px; }
  .chip-btn { height: 44px; min-width: 44px; }
  .chip-btn--icon { width: 44px; }
  .btn { height: 56px; }
}

/* ---------- Reduced motion: show everything, no heavy animation ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  [data-split] { visibility: visible; }
  .loader { display: none; }
}
