/* ==========================================================================
   STAY 하늘담 — base.css
   Design tokens, reset, typography, form + photo primitives.
   ========================================================================== */

:root {
  /* palette — midnight deep teal / sand / seafoam */
  --ink: #07141a;
  --ink-2: #0b1e26;
  --ink-3: #103038;
  --ink-4: #17434c;
  --sand: #e7dccb;
  --sand-2: #cfc3af;
  --sand-3: #a89c88;
  --foam: #7fb8ae;
  --foam-2: #9ed3c9;
  --paper: #f5f1e8;
  --paper-2: #ebe4d6;
  --tealblend: #0e4753;

  /* type */
  --ff: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", system-ui, "Malgun Gothic", sans-serif;
  --ff-display: "Cormorant Garamond", "Times New Roman", var(--ff), serif;

  --fs-hero: clamp(2.75rem, 7.4vw, 6.25rem);
  --fs-h2: clamp(1.9rem, 4.2vw, 3.4rem);
  --fs-h3: clamp(1.2rem, 1.9vw, 1.6rem);
  --fs-lead: clamp(1.02rem, 1.5vw, 1.3rem);
  --fs-body: clamp(0.97rem, 1.02vw, 1.06rem);
  --fs-sm: 0.875rem;
  --fs-xs: 0.78rem;

  /* space */
  --gut: clamp(1.25rem, 4vw, 3rem);
  --sec: clamp(4.5rem, 9vw, 8.5rem);
  --max: 1280px;

  --r-s: 4px;
  --r-m: 10px;
  --r-l: 18px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html.is-locked {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--sand);
  font-family: var(--ff);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  word-break: keep-all;
}

img,
svg,
picture {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: -0.035em;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---------- focus + a11y ------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--foam-2);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 200;
  padding: 0.85rem 1.4rem;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: 0 0 var(--r-m) var(--r-m);
  transform: translate(-50%, -110%);
  transition: transform 0.2s var(--ease);
}

.skip:focus-visible {
  transform: translate(-50%, 0);
}

.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- layout ------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.section {
  position: relative;
  padding-block: var(--sec);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.35rem;
  color: var(--foam);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  line-height: 1.5;
}

.eyebrow::before {
  content: "";
  width: clamp(24px, 4vw, 56px);
  height: 1px;
  background: currentColor;
  opacity: 0.65;
}

.h2 {
  font-size: var(--fs-h2);
  font-weight: 300;
}

.h2 em {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--foam-2);
  /* Korean has no italic face, so the browser synthesises a slant that would
     otherwise collide with the next glyph. */
  padding-inline-end: 0.06em;
}

.lead {
  max-width: 46ch;
  color: var(--sand-2);
  font-size: var(--fs-lead);
  line-height: 1.85;
  font-weight: 300;
}

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: rgba(231, 220, 203, 0.16);
}

/* light (sand) sections */
.on-light {
  background: var(--paper);
  color: var(--ink-2);
}

.on-light .eyebrow {
  color: #2c6b6c;
}

.on-light .lead {
  color: #3c4f55;
}

.on-light .h2 em {
  color: #1d5a63;
}

.on-light .rule {
  background: rgba(7, 20, 26, 0.14);
}

/* ---------- buttons ------------------------------------------------------ */

.btn {
  --btn-bg: var(--foam);
  --btn-fg: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.8rem 1.6rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  transition: transform 0.35s var(--ease-out), background-color 0.3s var(--ease),
    color 0.3s var(--ease);
}

.btn:hover {
  background: var(--foam-2);
  transform: translateY(-2px);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--sand);
  box-shadow: inset 0 0 0 1px rgba(231, 220, 203, 0.4);
}

.btn--ghost:hover {
  --btn-fg: var(--ink);
  background: var(--sand);
}

.on-light .btn--ghost {
  --btn-fg: var(--ink-2);
  box-shadow: inset 0 0 0 1px rgba(7, 20, 26, 0.3);
}

.on-light .btn--ghost:hover {
  --btn-fg: var(--paper);
  background: var(--ink-2);
}

.btn--dark {
  --btn-bg: var(--ink-2);
  --btn-fg: var(--paper);
}

.btn--dark:hover {
  background: var(--ink-3);
}

/* text link with animated underline */
.tlink {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-block: 0.3rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--foam-2);
}

.tlink::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.24);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}

.tlink:hover::after {
  transform: scaleX(1);
}

.on-light .tlink {
  color: #1d5a63;
}

/* ---------- photo treatment (unifies mixed source photography) ----------- */

.ph {
  --tint: 0.3;
  --scrim: 0.42;
  display: block;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink-2);
}

.ph > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.84) contrast(1.06) brightness(0.97);
}

.ph::before,
.ph::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ph::before {
  background: var(--tealblend);
  mix-blend-mode: color;
  opacity: var(--tint);
}

.ph::after {
  background: linear-gradient(
      180deg,
      rgba(7, 20, 26, calc(var(--scrim) * 0.55)) 0%,
      rgba(7, 20, 26, 0) 34%,
      rgba(7, 20, 26, calc(var(--scrim) * 0.35)) 62%,
      rgba(7, 20, 26, var(--scrim)) 100%
    ),
    radial-gradient(
      130% 90% at 50% 4%,
      rgba(127, 184, 174, 0.14),
      rgba(127, 184, 174, 0) 62%
    );
}

.ph--soft {
  --tint: 0.18;
  --scrim: 0.3;
}

.ph--deep {
  --tint: 0.36;
  --scrim: 0.72;
}

.ph--flat::after {
  background: linear-gradient(
    180deg,
    rgba(7, 20, 26, 0.1),
    rgba(7, 20, 26, 0.28)
  );
}

/* ---------- forms -------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.field > label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sand-2);
}

/* the consent checkbox keeps normal sentence typography */
.field > label.chk {
  font-size: var(--fs-sm);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--sand);
  background: rgba(231, 220, 203, 0.06);
  border: 1px solid rgba(231, 220, 203, 0.24);
  border-radius: var(--r-s);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.field textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.7;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: rgba(231, 220, 203, 0.45);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--foam);
  background: rgba(127, 184, 174, 0.09);
  outline: none;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--foam-2);
  outline-offset: 2px;
}

.field ::placeholder {
  color: rgba(231, 220, 203, 0.42);
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--foam) 50%),
    linear-gradient(135deg, var(--foam) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}

.field option {
  color: #101010;
}

.err {
  min-height: 1.1rem;
  color: #ffb3a7;
  font-size: var(--fs-xs);
  line-height: 1.4;
}

.field--bad input,
.field--bad select,
.field--bad textarea {
  border-color: #e08a7c;
}

.formnote {
  margin-top: 0.9rem;
  padding: 0.9rem 1.1rem;
  border-left: 2px solid var(--foam);
  background: rgba(127, 184, 174, 0.1);
  color: var(--sand);
  font-size: var(--fs-sm);
  line-height: 1.7;
}

.formnote:empty {
  display: none;
}

.formnote b {
  color: var(--foam-2);
}

/* ---------- scroll reveal (base state) ---------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

.mask {
  display: block;
  overflow: hidden;
}

.mask > span {
  display: block;
  transform: translate3d(0, 110%, 0);
  transition: transform 1.15s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 110ms);
}

.is-in > .mask > span,
.mask.is-in > span {
  transform: none;
}
