@import url("https://fonts.googleapis.com/earlyaccess/nanumgothic.css");

@font-face {
  font-family: "Aggravo";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2108@1.1/SBAggroL.woff") format("woff");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Aggravo";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2108@1.1/SBAggroM.woff") format("woff");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Aggravo";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2108@1.1/SBAggroB.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas-light: #ffffff;
  --canvas-cream: #fbfbf5;
  --ink: #000000;
  --on-primary: #ffffff;
  --aloe: #c1fbd4;
  --pistachio: #d4f9e0;
  --hairline: #e4e4e7;
  --shade-30: #d4d4d8;
  --shade-40: #a1a1aa;
  --shade-50: #71717a;
  --shade-60: #52525b;
  --shade-70: #3f3f46;
  --danger: #b42318;
  --shadow-paper: 0 8px 8px rgba(0, 0, 0, 0.1), 0 4px 4px rgba(0, 0, 0, 0.1),
    0 2px 2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas-cream);
  font-family: "Nanum Gothic", "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "ss03";
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

h1,
h2,
p {
  margin: 0;
}

.site-header,
.nav-actions,
.top-links,
.controls,
.surface-head,
.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: 12px 24px;
  color: var(--ink);
  background: var(--canvas-light);
  font-size: 16px;
  font-family: "Aggravo", "Nanum Gothic", sans-serif;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary,
.download-button {
  color: var(--on-primary);
  background: var(--ink);
}

.button-primary:hover,
.download-button:hover {
  background: var(--shade-70);
}

.button-outline {
  border-color: var(--ink);
}

.button-aloe {
  background: var(--aloe);
}

.button-quiet {
  min-height: 36px;
  padding: 8px 16px;
  background: var(--shade-30);
  font-size: 14px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.is-hidden {
  display: none !important;
}

.site-header {
  justify-content: space-between;
  width: min(100% - 48px, 1440px);
  margin: 0 auto;
  padding: 24px 0 0;
}

.brand {
  font-family: "Aggravo", "Nanum Gothic", sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
}

.top-links {
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--shade-60);
  font-size: 14px;
  font-weight: 500;
}

.top-links a,
.site-footer a {
  text-decoration: none;
}

.top-links a:hover,
.site-footer a:hover {
  text-decoration: underline;
}

.hero {
  width: min(100% - 48px, 1440px);
  margin: 0 auto;
  padding: 56px 0 48px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--shade-70);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.72px;
  text-transform: uppercase;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

h1 {
  max-width: 980px;
  font-family: "Aggravo", "Nanum Gothic", sans-serif;
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 2.4px;
}

.hero-copy {
  max-width: 760px;
  color: var(--shade-50);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.56;
  word-break: keep-all;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 24px;
  width: min(100% - 48px, 1440px);
  margin: 0 auto;
  padding: 0 0 64px;
}

.download-surface,
.panel {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--canvas-light);
  box-shadow: var(--shadow-paper);
}

.download-surface {
  display: grid;
  gap: 24px;
  padding: 32px;
}

.surface-head,
.panel-head {
  justify-content: space-between;
}

h2 {
  font-family: "Aggravo", "Nanum Gothic", sans-serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: 0.42px;
}

.status-pill {
  min-height: 36px;
  border-radius: 9999px;
  padding: 8px 16px;
  color: var(--ink);
  background: var(--aloe);
  font-family: "Aggravo", "Nanum Gothic", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.49;
  white-space: nowrap;
}

.status-pill.is-missing {
  color: var(--danger);
  background: #fff1f0;
}

.download-form {
  display: grid;
  gap: 24px;
}

.url-field {
  display: grid;
  gap: 10px;
  color: var(--shade-60);
  font-size: 14px;
  font-weight: 500;
}

.url-field input {
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--ink);
  border-radius: 9999px;
  padding: 0 24px;
  color: var(--ink);
  background: var(--canvas-cream);
  font-size: 18px;
  outline: none;
}

.url-field input:focus {
  background: var(--pistachio);
}

.format-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.format-card {
  display: grid;
  gap: 8px;
  min-height: 148px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 24px;
  background: var(--canvas-cream);
  cursor: pointer;
}

.format-card:has(input:checked) {
  border-color: var(--ink);
  background: var(--aloe);
}

.format-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.format-title {
  font-family: "Aggravo", "Nanum Gothic", sans-serif;
  font-size: 42px;
  font-weight: 500;
  line-height: 1;
}

.format-copy {
  color: var(--shade-50);
  font-size: 16px;
  line-height: 1.5;
}

.controls {
  justify-content: space-between;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--shade-60);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.49;
}

select {
  min-width: 168px;
  min-height: 44px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--canvas-light);
}

.side-stack {
  display: grid;
  align-content: start;
  gap: 24px;
}

.panel {
  padding: 24px;
}

.panel-pistachio {
  background: var(--pistachio);
}

.file-list,
.results {
  display: grid;
  gap: 8px;
}

.results {
  margin-top: 22px;
}

.file-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-row,
.result-row,
.message {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--canvas-light);
}

.file-name,
.result-name {
  overflow-wrap: anywhere;
  font-family: "Aggravo", "Nanum Gothic", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.file-meta,
.result-meta {
  margin-top: 2px;
  color: var(--shade-50);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.49;
}

.remove-button {
  min-height: 36px;
  border: 0;
  border-radius: 9999px;
  padding: 8px 16px;
  color: var(--ink);
  background: var(--shade-30);
  font-family: "Aggravo", "Nanum Gothic", sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.remove-button:hover {
  color: var(--danger);
}

.empty-state {
  color: var(--shade-50);
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  padding: 24px 8px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.16);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transition: width 180ms ease;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 9999px;
  padding: 10px 18px;
  font-family: "Aggravo", "Nanum Gothic", sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.message {
  display: block;
  color: var(--danger);
  font-weight: 700;
}

.content-section,
.text-page,
.site-footer {
  width: min(100% - 48px, 960px);
  margin: 0 auto;
}

.content-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.38fr) minmax(0, 1fr);
  gap: 32px;
  padding: 8px 0 72px;
}

.content-copy {
  display: grid;
  gap: 14px;
  color: var(--shade-60);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
}

.text-page {
  display: grid;
  gap: 28px;
  padding: 72px 0;
}

.text-page h1 {
  font-size: clamp(42px, 7vw, 72px);
}

.text-page section {
  display: grid;
  gap: 10px;
}

.text-page p {
  color: var(--shade-60);
  font-size: 16px;
  line-height: 1.75;
  word-break: keep-all;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  justify-content: space-between;
  border-top: 1px solid var(--hairline);
  padding: 24px 0 40px;
  color: var(--shade-50);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .hero-grid,
  .workspace,
  .content-section {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 48px;
  }
}

@media (max-width: 640px) {
  .site-header,
  .hero,
  .workspace,
  .content-section,
  .text-page,
  .site-footer {
    width: min(100% - 24px, 1440px);
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-links {
    justify-content: flex-start;
  }

  .controls,
  .surface-head,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .status-pill,
  select {
    width: 100%;
  }

  .hero {
    padding: 40px 0 32px;
  }

  h1 {
    font-size: clamp(42px, 14vw, 56px);
    letter-spacing: 1.2px;
  }

  .download-surface,
  .panel {
    padding: 20px;
  }

  .format-picker {
    grid-template-columns: 1fr;
  }

  .url-field input {
    border-radius: 24px;
    padding: 16px 18px;
  }

  .file-row,
  .result-row {
    grid-template-columns: 1fr;
  }
}
