@import url('/static/extras.css');

:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f3f5ff;
  --text: #12141a;
  --muted: #69707d;
  --line: #e3e7ee;
  --accent: #4f46e5;
  --accent-dark: #4038c8;
  --danger: #b42318;
  --success: #067647;
  --shadow: 0 18px 50px rgba(28, 35, 55, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .68; }

.site-header,
main,
footer {
  width: min(1100px, calc(100% - 36px));
  margin-inline: auto;
}

.site-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-size: 1.15rem; font-weight: 850; letter-spacing: .04em; }
nav { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: .92rem; }
nav a:hover { color: var(--text); }
.lang-switch {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
}

.hero {
  min-height: 570px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 70px 0 50px;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .13em;
}
h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5.3rem);
  letter-spacing: -.055em;
  line-height: .98;
}
.hero-copy { margin: 22px 0 34px; color: var(--muted); font-size: 1.08rem; }

.shortener-card {
  width: min(800px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
  text-align: left;
}
.url-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 17px;
  outline: none;
  background: #fbfcfe;
  color: var(--text);
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
button {
  border: 0;
  border-radius: 14px;
  padding: 0 20px;
  min-height: 52px;
  background: var(--accent);
  color: white;
  font-weight: 750;
}
button:hover:not(:disabled) { background: var(--accent-dark); }
button.secondary { background: #eef0f7; color: var(--text); }
button.secondary:hover:not(:disabled) { background: #e3e6ef; }
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
button.ghost:hover:not(:disabled) { background: #f7f8fb; color: var(--text); }

.options { margin-top: 12px; color: var(--muted); font-size: .9rem; }
.options summary { cursor: pointer; width: max-content; }
.custom-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.custom-row span { color: var(--muted); }
.custom-row input { padding: 12px 14px; }
.status { min-height: 20px; margin: 12px 2px 0; color: var(--muted); font-size: .88rem; }
.status[data-state="success"] { color: var(--success); }
.status[data-state="error"] { color: var(--danger); }

.result {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 18px;
  align-items: center;
}
.result[hidden] { display: none; }
.result-main { min-width: 0; }
.result-label {
  display: block;
  font-size: .74rem;
  color: var(--muted);
  margin-bottom: 6px;
}
#short-url {
  display: block;
  color: var(--accent);
  font-weight: 780;
  font-size: 1.05rem;
  word-break: break-all;
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.result-actions button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: .88rem;
}
.qr-panel {
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}
.qr-panel img {
  display: block;
  width: 144px;
  height: 144px;
  margin: 4px auto 8px;
  border-radius: 8px;
}
.text-link {
  color: var(--accent);
  font-size: .82rem;
  font-weight: 700;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 36px 0;
}
.feature-grid article,
.future-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
}
.feature-grid strong { font-size: 1.06rem; }
.feature-grid p,
.future-copy p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}
.tool-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--accent);
  font-weight: 750;
  font-size: .9rem;
}
.future-card {
  margin: 18px 0 70px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
}
.future-card h2 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.5rem);
  letter-spacing: -.04em;
}

footer {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .86rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  .site-header { height: 64px; }
  .site-header > nav > a:not(.lang-switch) { display: none; }
  nav { gap: 0; }
  .hero { min-height: 520px; padding: 48px 0 36px; }
  h1 { font-size: clamp(2.55rem, 14vw, 4.2rem); }
  .url-row { grid-template-columns: 1fr; }
  .url-row button { width: 100%; }
  .feature-grid { grid-template-columns: 1fr; }
  .future-card { grid-template-columns: 1fr; }
  .result { grid-template-columns: 1fr; }
  .qr-panel { width: 170px; }
}

@media (max-width: 430px) {
  .site-header,
  main,
  footer { width: min(100% - 24px, 1100px); }
  .shortener-card { padding: 13px; border-radius: 20px; }
  .result-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .result-actions .ghost { grid-column: 1 / -1; }
  .qr-panel { width: 100%; }
}

.tool-main { min-height: calc(100vh - 172px); }
.tool-hero {
  text-align: center;
  padding: 72px 0 34px;
}
.tool-hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
}
.tool-hero > p:last-child {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}
.tool-card {
  width: min(860px, 100%);
  margin: 0 auto 72px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.field label {
  display: block;
  margin-bottom: 7px;
  font-size: .88rem;
  font-weight: 750;
}
.field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .76rem;
}
.field.full { width: 100%; }
.generated-block {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fbfcfe;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  outline: none;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
}
.tool-actions button {
  min-height: 44px;
  padding: 0 16px;
}
.mini-result {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-soft);
}
.mini-result[hidden] { display: none; }
#shortened-url {
  color: var(--accent);
  font-weight: 760;
  word-break: break-all;
}

@media (max-width: 700px) {
  .tool-hero { padding-top: 52px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { padding: 15px; border-radius: 20px; }
  .tool-actions { display: grid; grid-template-columns: 1fr; }
  .tool-actions button { width: 100%; }
}
