/* HamroEPS — site styles */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #0f172a;
  --muted: #556074;
  --border: #e1e6ef;
  --accent: #1f4fd8;
  --accent-strong: #173ea8;
  --accent-soft: #e7edfd;
  --on-accent: #ffffff;
  --hero-from: #1a3fb5;
  --hero-to: #2b6be6;
  --hero-text: #ffffff;
  --hero-muted: #d6e2ff;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 -4px 24px rgba(15, 23, 42, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Malgun Gothic",
    "Noto Sans KR", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1018;
    --surface: #141a25;
    --surface-2: #1b2331;
    --text: #e7ebf3;
    --muted: #9ba6b8;
    --border: #253043;
    --accent: #7ea4ff;
    --accent-strong: #a9c2ff;
    --accent-soft: #1a2640;
    --on-accent: #0c1018;
    --hero-from: #142c78;
    --hero-to: #1f4fbf;
    --hero-text: #ffffff;
    --hero-muted: #c3d3ff;
    --danger: #ff8a7a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 -4px 24px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.has-player {
  padding-bottom: 156px;
}

@media (min-width: 760px) {
  body.has-player {
    padding-bottom: 104px;
  }
}

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

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-strong);
}

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

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

[lang="ko"] {
  word-break: keep-all;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 760px) {
  .wrap {
    padding: 0 24px;
  }
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

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

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  gap: 4px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0 12px;
  border-radius: 8px;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  place-items: center;
}

.menu-toggle:hover {
  background: var(--surface-2);
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

.menu-toggle .icon-close,
.menu-open .menu-toggle .icon-menu {
  display: none;
}

.menu-open .menu-toggle .icon-close {
  display: block;
}

@media (max-width: 559px) {
  .brand-sub {
    display: none;
  }
  /* Without JS the links wrap onto a second row under the logo. */
  .nav {
    width: 100%;
    margin: 0 -12px 6px;
  }
  .js .menu-toggle {
    display: grid;
  }
  .js .nav {
    display: none;
  }
  .js.menu-open .nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 0 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  .js .nav a {
    min-height: 48px;
    font-size: 1rem;
  }
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
  color: var(--hero-text);
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -60% auto;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 65%);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hero-muted);
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 16ch;
}

.hero-lead {
  margin-top: 18px;
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
  color: var(--hero-muted);
  max-width: 56ch;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 12px 20px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.btn-light {
  background: #ffffff;
  color: #173ea8;
}

.btn-light:hover {
  background: #eef3ff;
  color: #173ea8;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.hero :focus-visible {
  outline-color: #ffffff;
}

.stats {
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 560px;
}

.stats li {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.stats strong {
  display: block;
  white-space: nowrap;
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stats span {
  font-size: 0.85rem;
  color: var(--hero-muted);
}

@media (max-width: 479px) {
  .hero {
    padding: 40px 0 44px;
  }
  .hero-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
    min-height: 48px;
  }
  .stats {
    gap: 8px;
  }
  .stats li {
    padding: 10px 10px 8px;
  }
  .stats strong {
    font-size: 1.2rem;
  }
  .stats span {
    font-size: 0.8rem;
  }
  .section {
    padding: 44px 0;
  }
}

/* ---------- Sections ---------- */

main {
  flex: 1;
}

.section {
  padding: 56px 0;
}

.section-head {
  margin-bottom: 24px;
  max-width: 62ch;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: -0.015em;
}

.section-head p {
  margin-top: 8px;
  color: var(--muted);
}

/* ---------- Track list ---------- */

.tracks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.track {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.track.is-current {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
}

.track-play {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex: none;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.track-play:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.track-play:active {
  transform: scale(0.96);
}

.track.is-playing .track-play {
  background: var(--accent);
  color: var(--on-accent);
}

.track-play svg {
  width: 22px;
  height: 22px;
}

.track-play .icon-pause,
.track.is-playing .track-play .icon-play {
  display: none;
}

.track.is-playing .track-play .icon-pause {
  display: block;
}

.track-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.track-title {
  margin-top: 2px;
  font-size: 1.08rem;
  font-weight: 700;
}

.track-en {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 2px;
}

.track-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.track-resume {
  color: var(--accent);
  font-weight: 600;
}

.track.is-playing .track-resume {
  display: none;
}

.track-download {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  text-decoration: none;
}

.track-download:hover,
.track-download[aria-expanded="true"] {
  color: var(--accent);
  background: var(--surface-2);
}

.track-parts {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.track-parts[hidden] {
  display: none;
}

.track-parts ol {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}

.track-parts a {
  display: block;
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.track-parts a:hover {
  background: var(--accent-soft);
}

.track-download svg {
  width: 20px;
  height: 20px;
}

.track-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: transparent;
}

.track-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.25s linear;
}

@media (max-width: 479px) {
  .track {
    gap: 10px;
    padding: 14px 8px 14px 12px;
  }
  .track-play {
    width: 46px;
    height: 46px;
  }
  .track-title {
    font-size: 1rem;
  }
}

@media (max-width: 374px) {
  .track-label {
    font-size: 0.75rem;
    letter-spacing: 0;
  }
}

.noscript-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

/* ---------- Tips ---------- */

.tips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.tip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.tip-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 12px;
}

.tip-icon svg {
  width: 22px;
  height: 22px;
}

.tip h3 {
  font-size: 1.05rem;
}

.tip p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- About ---------- */

.about {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-grid {
  display: grid;
  gap: 28px;
}

@media (min-width: 860px) {
  .about-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: start;
  }
}

.about-copy p + p {
  margin-top: 14px;
}

.about-copy p {
  color: var(--muted);
  font-size: 1.02rem;
}

.about-copy strong {
  color: var(--text);
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.checklist svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex: none;
  margin-top: 2px;
}

/* ---------- Content pages ---------- */

.page-head {
  padding: 48px 0 8px;
}

.page-head h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: -0.02em;
}

.page-head p {
  margin-top: 10px;
  color: var(--muted);
  max-width: 60ch;
}

.prose {
  max-width: 72ch;
  padding: 24px 0 64px;
}

.prose h2 {
  font-size: 1.2rem;
  margin: 32px 0 8px;
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose ul {
  padding-left: 1.25rem;
  margin: 8px 0 0;
}

.prose li + li {
  margin-top: 4px;
}

.prose strong {
  color: var(--text);
}

.prose .effective {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.contact-grid {
  display: grid;
  gap: 12px;
  padding: 24px 0 64px;
  max-width: 760px;
}

@media (min-width: 600px) {
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.contact-card h2 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-card h2 svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.contact-card p {
  margin-top: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.contact-card .sub {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 4px;
}

.contact-card a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.contact-card p:has(a) {
  margin-top: 2px;
}

.contact-card a:hover {
  text-decoration: underline;
}

.notfound {
  padding: 80px 0;
  text-align: center;
}

.notfound h1 {
  font-size: clamp(2rem, 6vw, 3rem);
}

.notfound p {
  color: var(--muted);
  margin: 12px auto 28px;
  max-width: 44ch;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------- Player bar ---------- */

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
}

.player[hidden] {
  display: none;
}

.player .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "info controls"
    "seek seek";
  gap: 8px 12px;
  align-items: center;
}

@media (min-width: 760px) {
  .player .wrap {
    grid-template-columns: minmax(0, 260px) auto minmax(0, 1fr);
    grid-template-areas: "info controls seek";
    gap: 20px;
  }
}

.player-info {
  grid-area: info;
  min-width: 0;
}

.player-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-title {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-status {
  font-size: 0.8rem;
  color: var(--danger);
}

.player-status:empty {
  display: none;
}

.player-controls {
  grid-area: controls;
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font: inherit;
}

.icon-btn:hover {
  background: var(--surface-2);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

.player-toggle {
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: var(--on-accent);
}

.player-toggle:hover {
  background: var(--accent-strong);
}

.player-toggle .icon-pause,
.player.is-playing .player-toggle .icon-play {
  display: none;
}

.player.is-playing .player-toggle .icon-pause {
  display: block;
}

.player.is-loading .player-toggle svg {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.player-rate {
  width: auto;
  min-width: 52px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px var(--border);
}

.player-seek {
  grid-area: seek;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.player-time {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 4.2ch;
}

.player-time:last-child {
  text-align: right;
}

.seek {
  --fill: 0%;
  flex: 1;
  min-width: 0;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.seek::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--fill), var(--surface-2) var(--fill));
}

.seek::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
}

.seek::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--accent);
}

.seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
}

.seek:focus-visible {
  outline-offset: 4px;
}

@media (max-width: 479px) {
  .player {
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  }
  .player .wrap {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "info"
      "seek"
      "controls";
    gap: 2px;
  }
  .player-info {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
  }
  .player-label {
    flex: none;
  }
  .player-title {
    flex: 1 1 0;
    min-width: 0;
    font-size: 0.92rem;
  }
  .player-status {
    flex-basis: 100%;
  }
  .player-controls {
    justify-content: center;
    gap: 14px;
  }
}
