/* Base styles (spec 6-3 fonts, 6-4 layout, 6-5 touch, 6-6 focus). Colors and sizes come from tokens.css. */

@font-face {
  font-family: 'Pretendard';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/Pretendard-Regular.subset.woff2') format('woff2');
}
@font-face {
  font-family: 'Pretendard';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/Pretendard-SemiBold.subset.woff2') format('woff2');
}
@font-face {
  font-family: 'Pretendard';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/Pretendard-Bold.subset.woff2') format('woff2');
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  -webkit-tap-highlight-color: var(--transparent);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  word-break: keep-all;
  overflow-wrap: anywhere;
  padding-top: env(safe-area-inset-top);
}

html.has-layer,
html.has-layer body {
  overflow: hidden;
}

h1, h2, h3, h4, p, ul, ol, figure {
  margin: 0;
}

h1 { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 700; }
h2 { font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 700; }
h3 { font-size: var(--fs-name); line-height: var(--lh-name); font-weight: 600; }

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

a {
  color: var(--primary);
  text-underline-offset: 3px;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  touch-action: manipulation;
}

[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
/* headings focused by script for screen readers (sheet titles, #app) are not controls */
[tabindex="-1"]:focus-visible { outline: none; }

/* main column: max 560px centered, 16px side gutter + safe areas (6-4) */
#app {
  display: block;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 calc(var(--gutter) + env(safe-area-inset-right)) var(--sp-6) calc(var(--gutter) + env(safe-area-inset-left));
  min-height: 60vh;
}
body:has(#tabbar:not([hidden])) #app {
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--fab) + var(--sp-8));
}
#app:focus { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.text-2 { color: var(--text-2); }
.caption { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); }
.body-sm { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }

noscript {
  display: block;
  padding: var(--sp-6) var(--gutter);
  font-size: var(--fs-body);
  color: var(--text);
}
