/* Chrome and reusable components: curtain, header, footer, buttons, forms, chat, cursor */

/* ---------- Bamboo curtain (opening + page transitions) ---------- */
.curtain {
  position: fixed;
  inset: 0;
  z-index: var(--z-curtain);
  display: grid;
  grid-template-columns: repeat(var(--slats, 9), 1fr);
  pointer-events: none;
}
.curtain.is-active {
  pointer-events: all;
}
.curtain__slat {
  position: relative;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 22%, rgba(255, 255, 255, 0.12) 50%, transparent 78%, rgba(0, 0, 0, 0.22)),
    var(--bamboo);
  transform-origin: top;
  will-change: transform;
}
.curtain__slat:nth-child(even) {
  background-color: #bea466;
}
/* bamboo nodes */
.curtain__slat::before,
.curtain__slat::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(rgba(60, 40, 10, 0.35), rgba(255, 255, 255, 0.15), rgba(60, 40, 10, 0.3));
}
.curtain__slat::before {
  top: calc(18% + var(--node, 0%));
}
.curtain__slat::after {
  top: calc(62% + var(--node, 0%));
}
.curtain__brand {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-curtain) + 1);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.2rem;
  pointer-events: none;
  color: var(--wood);
}
.curtain__brand svg {
  width: clamp(88px, 14vw, 150px);
  height: auto;
  overflow: visible;
}
.curtain__brand svg * {
  stroke: var(--wood);
}
.curtain__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 5rem);
  letter-spacing: -0.04em;
  line-height: 1;
  font-variation-settings: 'wdth' 80;
  display: flex;
  overflow: hidden;
}
.curtain__word span {
  display: inline-block;
  white-space: pre;
}
.curtain__meta {
  font-style: italic;
  font-size: var(--step--1);
  overflow: hidden;
}
.curtain__meta span {
  display: inline-block;
}
.curtain__count {
  position: fixed;
  right: var(--gutter);
  bottom: var(--gutter);
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-header);
  padding: 1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition:
    transform 0.5s var(--ease-out),
    background-color 0.4s,
    color 0.4s;
}
.site-header.is-hidden {
  transform: translateY(-110%);
}
.site-header.is-solid {
  background: color-mix(in srgb, var(--abaka) 88%, transparent);
  backdrop-filter: blur(10px);
  color: var(--wood);
}
.site-header[data-tone='light']:not(.is-solid) {
  color: var(--on-dark);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  font-variation-settings: 'wdth' 80;
  white-space: nowrap;
}
.brand svg {
  width: 38px;
  height: 38px;
  transition: transform 0.6s var(--ease-out);
}
.brand svg * {
  stroke: currentColor;
}
.brand:hover svg {
  transform: rotate(-8deg) scale(1.06);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid currentColor;
  background: transparent;
  border-radius: 999px;
  padding: 0.55rem 1rem 0.55rem 1.1rem;
  min-height: 44px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-toggle__bars {
  width: 20px;
  height: 10px;
  position: relative;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  transition: transform 0.45s var(--ease-out);
}
.nav-toggle__bars::before {
  top: 0;
}
.nav-toggle__bars::after {
  bottom: 0;
}
.nav-open .nav-toggle__bars::before {
  transform: translateY(4px) rotate(45deg);
}
.nav-open .nav-toggle__bars::after {
  transform: translateY(-4px) rotate(-45deg);
}

.site-header .header-cta {
  display: none;
}
@media (min-width: 760px) {
  .site-header .header-cta {
    display: inline-flex;
  }
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Full-screen menu */
.menu-panel {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-header) - 1);
  background: var(--leaf);
  color: var(--on-dark);
  display: grid;
  grid-template-columns: 1fr;
  padding: 6.5rem var(--gutter) 2rem;
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  overflow-y: auto;
}
.nav-open .site-header {
  color: var(--on-dark);
  background: transparent;
  backdrop-filter: none;
}
.menu-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.1rem;
}
.menu-panel__list a {
  display: inline-flex;
  align-items: baseline;
  gap: 1rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 1.2rem + 3.6vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-variation-settings: 'wdth' 78;
  transition:
    color 0.3s,
    transform 0.5s var(--ease-out);
}
.menu-panel__list a small {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0;
  color: var(--on-dark-muted);
}
.menu-panel__list a:hover,
.menu-panel__list a[aria-current='page'] {
  color: var(--kalamansi);
  transform: translateX(0.5rem);
}
.menu-panel__item {
  overflow: hidden;
}
.menu-panel__aside {
  display: none;
}
@media (min-width: 1000px) {
  .menu-panel {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: end;
  }
  .menu-panel__aside {
    display: grid;
    gap: 1.5rem;
    align-self: stretch;
    align-content: end;
  }
  .menu-panel__photo {
    border-radius: var(--radius-l);
    overflow: hidden;
    aspect-ratio: 4/5;
    max-height: 56vh;
  }
  .menu-panel__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s;
  }
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--wood);
  --btn-fg: var(--abaka);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 0;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--kalamansi);
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform 0.5s var(--ease-out);
}
.btn:hover::before,
.btn:focus-visible::before {
  transform: translateY(0);
}
.btn:hover,
.btn:focus-visible {
  color: var(--wood);
}
.btn__label {
  display: inline-grid;
  overflow: hidden;
  height: 1.3em;
  line-height: 1.3em;
}
.btn__label span {
  grid-area: 1/1;
  transition: transform 0.5s var(--ease-out);
}
.btn__label span + span {
  transform: translateY(100%);
}
.btn:hover .btn__label span:first-child {
  transform: translateY(-100%);
}
.btn:hover .btn__label span + span {
  transform: translateY(0);
}
.btn--light {
  --btn-bg: var(--abaka);
  --btn-fg: var(--wood);
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: currentColor;
  box-shadow: inset 0 0 0 1px currentColor;
}
.btn--sm {
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
}
.btn[disabled] {
  opacity: 0.5;
  cursor: progress;
}

.link-line {
  position: relative;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  display: inline-block;
  padding-bottom: 2px;
}
.link-line::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: currentColor;
  transform-origin: right;
  transition: transform 0.5s var(--ease-out);
}
.link-line:hover::after {
  transform: scaleX(0);
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  position: relative;
  min-height: 88svh;
  display: grid;
  align-items: end;
  padding: 8rem var(--gutter) clamp(2.5rem, 5vw, 4.5rem);
  color: var(--on-dark);
  overflow: hidden;
  isolation: isolate;
}
.page-hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.page-hero__media img {
  width: 100%;
  height: 120%;
  object-fit: cover;
}
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(20, 12, 8, 0.25) 0%, rgba(20, 12, 8, 0.15) 40%, rgba(20, 12, 8, 0.78) 100%);
}
.page-hero__inner {
  width: min(100%, var(--max));
  margin-inline: auto;
  display: grid;
  gap: 1.5rem;
}
.page-hero__inner .lede {
  color: var(--on-dark);
}
.crumbs {
  font-style: italic;
  color: var(--on-dark-muted);
  font-size: var(--step--1);
}
.crumbs a {
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--kalamansi);
}

/* ---------- Forms ---------- */
.form {
  display: grid;
  gap: 1.25rem;
}
.form__row {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .form__row--2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .form__row--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.field {
  display: grid;
  gap: 0.35rem;
  position: relative;
}
.field label,
.field legend {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}
.field .req {
  color: var(--danger);
}
.section--leaf .field .req,
.section--wood .field .req {
  color: var(--kalamansi);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-s);
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  background: color-mix(in srgb, currentColor 4%, transparent);
  transition:
    border-color 0.25s,
    box-shadow 0.25s,
    background-color 0.25s;
}
.field textarea {
  min-height: 140px;
  resize: vertical;
}
.field select option {
  color: var(--wood);
}
.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: color-mix(in srgb, currentColor 60%, transparent);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--bamboo-deep);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kalamansi) 60%, transparent);
}
.field .hint {
  font-size: var(--step--1);
  font-style: italic;
  opacity: 0.8;
}
.field .error {
  font-size: var(--step--1);
  color: var(--danger);
  min-height: 0;
}
.section--leaf .field .error,
.section--wood .field .error {
  color: #ffb4a0;
}
.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
  border-color: var(--danger);
}
.form__status {
  font-family: var(--font-display);
  font-weight: 600;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border: 0;
  padding: 0;
  margin: 0;
}
.chip {
  position: relative;
}
.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  transition:
    background-color 0.25s,
    color 0.25s,
    transform 0.3s var(--ease-out);
}
.chip input:checked + span {
  background: var(--wood);
  color: var(--abaka);
  border-color: var(--wood);
}
.section--leaf .chip input:checked + span,
.section--wood .chip input:checked + span {
  background: var(--kalamansi);
  color: var(--wood);
  border-color: var(--kalamansi);
}
.chip input:focus-visible + span {
  outline: 3px solid var(--kalamansi);
  outline-offset: 2px;
}
.chip:active span {
  transform: scale(0.95);
}
.form-success {
  display: none;
  gap: 1rem;
  padding: 2rem;
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--kalamansi) 22%, transparent);
}
.form.is-sent > :not(.form-success) {
  display: none;
}
.form.is-sent .form-success {
  display: grid;
}
.check-draw path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
}
.form.is-sent .check-draw path {
  animation: draw 0.7s 0.2s var(--ease-out) forwards;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--wood);
  color: var(--on-dark);
  padding: clamp(4rem, 8vw, 7rem) var(--gutter) 2rem;
  overflow: hidden;
  position: relative;
}
.site-footer__grid {
  width: min(100%, var(--max));
  margin-inline: auto;
  display: grid;
  gap: 3rem;
}
@media (min-width: 900px) {
  .site-footer__grid {
    grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
  }
}
.site-footer h3 {
  font-size: var(--step-1);
  margin-bottom: 1rem;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}
.site-footer a {
  text-decoration: none;
  color: var(--on-dark-muted);
  transition: color 0.25s;
}
.site-footer a:hover {
  color: var(--kalamansi);
}
.footer-news {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.footer-news input {
  flex: 1 1 200px;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(239, 231, 214, 0.35);
  background: transparent;
  padding: 0 1.1rem;
}
.footer-word {
  width: min(100%, var(--max));
  margin: clamp(3rem, 6vw, 5rem) auto 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4rem, 21vw, 19rem);
  letter-spacing: -0.07em;
  line-height: 0.8;
  font-variation-settings: 'wdth' 75;
  color: var(--bamboo);
  display: flex;
  justify-content: center;
  white-space: nowrap;
  user-select: none;
}
.footer-word span {
  display: inline-block;
}
.footer-base {
  width: min(100%, var(--max));
  margin: 2rem auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: var(--step--1);
  color: var(--on-dark-muted);
}

/* ---------- Chat widget ---------- */
.chat-launcher {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: var(--z-chat);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  background: var(--wood);
  color: var(--abaka);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px -10px rgba(43, 26, 18, 0.6);
}
.chat-launcher svg {
  width: 28px;
  height: 28px;
}
.chat-launcher__dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--kalamansi);
  box-shadow: 0 0 0 3px var(--wood);
}
.chat-launcher__dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--kalamansi);
  animation: ping 2.2s var(--ease-out) infinite;
}
@keyframes ping {
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}
.chat-panel {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 76px);
  z-index: var(--z-chat);
  width: min(380px, calc(100vw - 2rem));
  height: min(560px, calc(100svh - 120px));
  display: none;
  grid-template-rows: auto 1fr auto auto;
  background: var(--abaka);
  color: var(--wood);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 30px 60px -20px rgba(43, 26, 18, 0.55),
    0 0 0 1px rgba(43, 26, 18, 0.08);
  transform-origin: bottom right;
}
.chat-panel.is-open {
  display: grid;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 1rem 1.1rem;
  background: var(--leaf);
  color: var(--on-dark);
}
.chat-head img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
}
.chat-head strong {
  font-family: var(--font-display);
  display: block;
  line-height: 1.1;
}
.chat-head small {
  font-style: italic;
  color: var(--on-dark-muted);
}
.chat-close {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: inherit;
  display: grid;
  place-items: center;
}
.chat-close:hover {
  background: rgba(255, 255, 255, 0.1);
}
.chat-log {
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overscroll-behavior: contain;
}
.msg {
  max-width: 85%;
  padding: 0.65rem 0.9rem;
  border-radius: 16px;
  font-size: 0.98rem;
  line-height: 1.45;
}
.msg--bot {
  background: #fff8ea;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.msg--me {
  background: var(--wood);
  color: var(--abaka);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.msg a {
  font-weight: 600;
}
.typing {
  display: inline-flex;
  gap: 4px;
  padding: 0.85rem 1rem;
}
.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-muted);
  animation: bob 1s infinite var(--ease-in-out);
}
.typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.typing i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes bob {
  50% {
    transform: translateY(-4px);
    opacity: 0.5;
  }
}
.chat-quick {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0 1rem 0.6rem;
  scrollbar-width: none;
}
.chat-quick button {
  flex: none;
  border: 1px solid rgba(43, 26, 18, 0.25);
  background: transparent;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  min-height: 36px;
  font-size: 0.9rem;
  transition:
    background-color 0.2s,
    transform 0.2s;
}
.chat-quick button:hover {
  background: var(--abaka-2);
}
.chat-quick button:active {
  transform: scale(0.94);
}
.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(43, 26, 18, 0.12);
}
.chat-form input {
  flex: 1;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(43, 26, 18, 0.2);
  background: #fff8ea;
  padding: 0 1rem;
}
.chat-form button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--wood);
  color: var(--abaka);
  display: grid;
  place-items: center;
}

/* ---------- Custom cursor (fine pointers only) ---------- */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: var(--z-cursor);
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--kalamansi);
  mix-blend-mode: difference;
  pointer-events: none;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--wood);
  opacity: 0;
}
.cursor__label {
  opacity: 0;
  white-space: nowrap;
}
@media (hover: none), (pointer: coarse) {
  .cursor {
    display: none;
  }
}

/* ---------- Scroll progress ---------- */
.progress {
  position: fixed;
  left: 0;
  top: 0;
  height: 3px;
  width: 100%;
  background: var(--kalamansi);
  transform-origin: left;
  transform: scaleX(0);
  z-index: calc(var(--z-header) + 1);
}
.site-header.is-solid .header-cta {
  --btn-bg: var(--wood);
  --btn-fg: var(--abaka);
}
