:root {
  --bg: #000000;
  --fg: #ffffff;
  --muted: #888888;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.5);
  --accent: #ffffff;
  --in: #ffffff;
  --green: #3ad29f;
  --red: #ff5a5a;
  --amber: #ffc24b;
  --blue: #5aa6ff;
  --font-en: 'Montserrat', sans-serif;
  --font-ko: 'Pretendard', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ko);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
}

#app {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 32px 28px 24px;
}

/* ===== Header / Brand ===== */
#brand-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.brand-mark {
  font-family: var(--font-en);
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 18px;
}

.brand-sub {
  font-family: var(--font-en);
  font-weight: 400;
  letter-spacing: 0.32em;
  font-size: 11px;
  color: var(--muted);
}

/* ===== Clock ===== */
#clock-section {
  flex: 0 0 auto;
  padding: 56px 0 48px;
  text-align: center;
}

#date-line {
  font-family: var(--font-en);
  font-weight: 400;
  letter-spacing: 0.22em;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}

#date-line .dot {
  color: var(--line-strong);
}

#weekday {
  font-family: var(--font-ko);
  font-weight: 500;
  letter-spacing: 0.1em;
}

#clock {
  font-family: var(--font-en);
  font-weight: 300;
  font-size: clamp(48px, 16vw, 84px);
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

#clock #time {
  display: inline-block;
}

/* ===== Form ===== */
#form-section {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.field {
  margin-bottom: 28px;
}

.field label {
  display: block;
  font-family: var(--font-en);
  font-weight: 500;
  letter-spacing: 0.28em;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
}

#name-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  color: var(--fg);
  font-family: var(--font-ko);
  font-size: 22px;
  font-weight: 500;
  padding: 8px 2px 12px;
  outline: none;
  transition: border-color 0.25s ease;
}

#name-input::placeholder {
  color: #4a4a4a;
  font-weight: 400;
}

#name-input:focus {
  border-bottom-color: var(--fg);
}

/* ===== Buttons ===== */
.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}

.punch-btn {
  position: relative;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--fg);
  padding: 26px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.08s ease;
  overflow: hidden;
}

.punch-btn .btn-en {
  font-family: var(--font-en);
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 14px;
}

.punch-btn .btn-ko {
  font-family: var(--font-ko);
  font-weight: 400;
  letter-spacing: 0.1em;
  font-size: 12px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.punch-btn:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.punch-btn:hover .btn-ko {
  color: var(--bg);
}

.punch-btn:active {
  transform: scale(0.98);
}

.punch-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.punch-btn.loading {
  pointer-events: none;
}

.punch-btn.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  animation: shimmer 1s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ===== Status ===== */
#status-message {
  margin-top: 26px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-ko);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#status-message.show {
  opacity: 1;
  transform: translateY(0);
}

#status-message.success { color: var(--green); }
#status-message.error { color: var(--red); }

#status-message .badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#status-message .badge .action-tag {
  font-family: var(--font-en);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 12px;
  border: 1px solid currentColor;
  padding: 4px 10px;
  border-radius: 2px;
}

#status-message {
  flex-direction: column;
  gap: 10px;
}

#status-message .work-time {
  font-family: var(--font-en);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 14px;
  color: var(--fg);
}

/* ===== Footer ===== */
#page-footer {
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-family: var(--font-en);
  font-weight: 400;
  letter-spacing: 0.16em;
  font-size: 10px;
  color: #555;
  text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 380px) {
  #app { padding: 24px 20px 20px; }
  .punch-btn { padding: 22px 12px; }
}
