/* Frame Labs Studio prototype: the bar, the menu, the chip, the motion button and utilities. Load after site.css.
   js/page.js reads .site-bar, .brand, .nav-toggle[aria-controls], .site-nav, .call and adds the header fit steps
   (fit-1..5) and the open menu (nav-open); see handoff/proto/PORT.md. */

.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; }
.skip { position: fixed; z-index: 60; left: 12px; top: 8px; padding: 10px 18px; border-radius: 2px; background: var(--ink); color: #fff;
  font-weight: 600; text-decoration: none; transform: translateY(-220%); }
.skip:focus { transform: none; outline: 3px solid var(--ink); outline-offset: 2px; }

/* ---------- the bar: a strip of card across the top, its cut edge casting a soft shadow ---------- */
.bar { position: fixed; z-index: 20; left: 0; right: 0; top: 0; height: var(--bar-h); display: flex; align-items: center; gap: 20px;
  padding: 0 clamp(14px, 3.4vw, 44px); background: var(--grain), linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0)), var(--paper);
  box-shadow: inset 0 -1px 0 rgba(35, 31, 28, .09), 0 1px 2px rgba(35, 31, 28, .1), 0 10px 22px -14px rgba(35, 31, 28, .3); }
.brand { display: flex; align-items: center; min-height: 44px; text-decoration: none; white-space: nowrap; color: var(--ink); }
.brand .bn { display: flex; flex-direction: column; justify-content: center; }
.brand .b1 { font: 600 19px/1 var(--font); letter-spacing: -.01em; }
.site-bar .site-nav { display: block; margin-left: auto; font-size: 16px; }
.site-nav ul { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.site-nav a { display: flex; align-items: center; min-height: 44px; padding: 0 11px; border-radius: 2px; color: var(--text);
  text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--ink); background: rgba(35, 31, 28, .05); }
.site-nav a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 8px; }
/* the call: the hero's teal card, a size smaller */
.call { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 2px;
  font: 600 16px/1.15 var(--font); text-align: center; text-decoration: none; white-space: nowrap; color: #fff;
  background: var(--grain), linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 40%), var(--accent);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .22), inset -1px -1px 0 rgba(8, 30, 30, .22), 1px 1px 2px rgba(35, 31, 28, .2);
  transition: transform var(--t-state) var(--ease-paper); -webkit-tap-highlight-color: transparent; }
.call:hover, .call:active { --accent: #244E4C; }
/* the autumn look (site.css html.look-autumn): the call vermilion, the skip link's ring in the accent */
html.look-autumn .call { box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .25), inset -1px -1px 0 rgba(60, 10, 0, .18), 1px 1px 2px rgba(35, 31, 28, .2); }
html.look-autumn .call:hover, html.look-autumn .call:active { --accent: #C8361D; }
html.look-autumn .skip:focus { outline-color: var(--accent); }
.call:hover { transform: translateY(-1px); }
.call:active { transform: translateY(1px); transition-duration: var(--t-press); }
.nav-toggle { display: none; }
.brand:focus-visible, .site-nav a:focus-visible, .call:focus-visible, .nav-toggle:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
@media (min-width: 900px) and (max-width: 1099.98px) {
  .site-bar { gap: 12px; }
  .site-nav a { padding: 0 8px; }
}

/* ---------- the chip under the bar (as on the reference site): scrolls away with the page, never covers text ---------- */
.draft { position: absolute; z-index: 21; left: clamp(12px, 3vw, 30px); top: calc(var(--bar-h) + 10px); margin: 0; padding: 4px 10px;
  font: 600 14px/1.5 var(--font); letter-spacing: .03em; color: var(--paper); background: rgba(35, 31, 28, .8); border-radius: 2px;
  pointer-events: none; }

/* ---------- the motion button (WCAG 2.2.2): a small card under the bar's right end, fixed ---------- */
.motion { position: fixed; z-index: 19; right: clamp(12px, 3vw, 30px); top: calc(var(--bar-h) + 10px); display: inline-flex; align-items: center;
  gap: 9px; min-height: 44px; min-width: 44px; padding: 0 14px 0 13px; border: 0; border-radius: 2px; cursor: pointer;
  font: 600 14px/1 var(--font); color: var(--ink); background: var(--grain), var(--face), var(--paper);
  box-shadow: var(--edge), 0 0 0 1px rgba(35, 31, 28, .08), var(--lift-small); -webkit-tap-highlight-color: transparent; }
.motion-i { flex: none; width: 11px; height: 13px; border: solid currentColor; border-width: 0 4px; }   /* pause: two bars */
.motion.is-off .motion-i { width: 0; height: 0; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent currentColor; }   /* play */
.motion:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
/* the clock already stands still under reduced motion: no button */
@media (prefers-reduced-motion: reduce) { .motion { display: none; } }

/* ---------- narrow screens: the menu ---------- */
@media (max-width: 899.98px) {
  .site-bar { gap: 10px; }
  .site-bar.nav-open { z-index: 40; }   /* the open menu lies over the chip and the motion button */
  .site-bar .call { order: 2; margin-left: auto; }
  .nav-toggle { order: 3; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px;
    padding: 0 14px 0 12px; border: 0; border-radius: 2px; cursor: pointer; color: var(--ink); font: 600 16px/1 var(--font);
    background: var(--grain), var(--face), var(--paper); box-shadow: var(--edge), 0 0 0 1px rgba(35, 31, 28, .14), 1px 1px 2px rgba(35, 31, 28, .14); }
  .nav-toggle-icon { position: relative; width: 18px; height: 14px; flex: none; }
  .nav-toggle-icon i { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform .25s, opacity .2s; }
  .nav-toggle-icon i:nth-child(1) { top: 0; }
  .nav-toggle-icon i:nth-child(2) { top: 6px; }
  .nav-toggle-icon i:nth-child(3) { top: 12px; }
  .nav-open .nav-toggle-icon i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-open .nav-toggle-icon i:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle-icon i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  /* the menu: a card that hangs from the bar */
  .site-bar .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; margin: 0; padding: 6px clamp(18px, 5vw, 40px) 18px;
    max-height: calc(100vh - var(--bar-h)); max-height: calc(100svh - var(--bar-h)); overflow-y: auto; overscroll-behavior: contain;
    background: var(--grain), var(--paper); box-shadow: inset 0 1px 0 rgba(35, 31, 28, .08), var(--lift); }
  .site-bar.nav-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav li + li { border-top: 1px solid rgba(35, 31, 28, .1); }
  .site-nav a { min-height: 56px; padding: 0 4px; border-radius: 0; font-size: 19px; font-weight: 600; color: var(--ink); }
  /* without scripts the menu simply stays open in the flow under the bar, and the bar scrolls away with the page */
  html:not(.js) .nav-toggle { display: none; }
  html:not(.js) .site-bar { position: relative; flex-wrap: wrap; row-gap: 0; height: auto; }
  html:not(.js) .site-bar > .brand { min-height: var(--bar-h); }
  html:not(.js) .site-bar .site-nav { display: block; position: static; order: 4; flex: 0 0 100%; max-height: none; overflow: visible;
    padding: 0 0 12px; background: none; box-shadow: none; }
  html:not(.js) .draft { position: relative; top: auto; left: auto; width: fit-content; margin: 12px 0 0 clamp(12px, 3vw, 30px); }
  html:not(.js) .hero { padding-top: 36px; }
}
/* phones: the motion button is its icon alone (its words stay its name); the call may take two lines (the English) */
@media (max-width: 760px) {
  .brand .b1 { font-size: 17px; }
  .call { padding: 0 12px; font-size: 15px; white-space: normal; max-width: 8.5em; }
  .motion { width: 44px; padding: 0; justify-content: center; }
  .motion-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* upright phones: the sheets sit at the top of the screen (site.css), so the button moves to the foot, over the table */
@media (max-width: 760px) and (orientation: portrait) {
  .motion { top: auto; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 480px) {
  .site-bar { padding: 0 12px; gap: 8px; }
  .nav-toggle { padding: 0; width: 44px; }   /* the icon alone; 메뉴 stays its name */
  .nav-toggle-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 359.98px) {
  .site-bar { padding: 0 8px; gap: 6px; }
  .brand .b1 { font-size: 16px; }
  .call { padding: 0 9px; font-size: 14px; }
}
/* js/page.js fit steps, added in order only while the row still overflows (text spacing, zoom, a wider fallback font) */
.site-bar.fit-2 { padding-left: 8px; padding-right: 8px; gap: 6px; }
.site-bar.fit-2 .call { padding: 0 8px; }
@media (min-width: 900px) { .site-bar.fit-2 .site-nav a { padding: 0 6px; } }
.site-bar.fit-4 .brand .b1 { font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  .call, .nav-toggle-icon i { transition: none; }
  .call:hover, .call:active { transform: none; }
}
@media (forced-colors: active) {
  .call, .nav-toggle, .motion { border: 2px solid ButtonText; }
  .nav-toggle-icon i { forced-color-adjust: none; background: ButtonText; }
  .motion-i { forced-color-adjust: none; }
}
