/* edground — shared design system (light by default; dark via [data-theme="dark"] on Exam Timer) */

:root {
  --bg: #f5f3fa;
  --bg-subtle: #ece8f4;
  --panel: #ffffff;
  --panel-hover: #f8f6fc;
  --text: #1c1830;
  --muted: #5c5670;
  --line: rgba(91, 33, 182, 0.1);
  --line-strong: #dcd6eb;
  --accent: #7c3aed;
  --accent-soft: rgba(124, 58, 237, 0.12);
  --accent-2: #6d28d9;
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.12);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.14);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --shadow: 0 12px 40px rgba(76, 29, 149, 0.08);
  --radius: 14px;
  --radius-lg: 18px;
  --font: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --nav-height: 56px;
  --focus: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent);
  --page-gradient: radial-gradient(
    ellipse 110% 75% at 50% -18%,
    rgba(124, 58, 237, 0.07),
    transparent 52%
  );
  --header-bg: rgba(255, 255, 255, 0.88);
}

:root[data-theme="dark"] {
  --bg: #0f1218;
  --bg-subtle: #181c26;
  --panel: #1a1f2c;
  --panel-hover: #222836;
  --text: #eceaf2;
  --muted: #9b94ad;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.15);
  --accent-2: #c4b5fd;
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  --page-gradient: radial-gradient(
    ellipse 120% 80% at 50% -20%,
    rgba(167, 139, 250, 0.1),
    transparent 50%
  );
  --header-bg: color-mix(in srgb, var(--bg) 90%, transparent);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image: var(--page-gradient);
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 4px;
}

/* Shell */

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.site-header__cluster {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Logo: flex items default to min-width:auto, which uses the image’s intrinsic width and can blow up the layout */
.site-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
  max-width: min(220px, 55vw);
  text-decoration: none;
  line-height: 0;
}

.site-logo img {
  display: block;
  height: 34px;
  max-height: 34px;
  width: auto;
  max-width: 100%;
  min-width: 0;
  flex-shrink: 1;
  object-fit: contain;
  object-position: left center;
}

/* Exam Timer: alternate header logo when dark theme is active */
.site-logo--theme .site-logo__brand--dark {
  display: none;
}

:root[data-theme="dark"] .site-logo--theme .site-logo__brand--light {
  display: none;
}

:root[data-theme="dark"] .site-logo--theme .site-logo__brand--dark {
  display: block;
}

.site-logo:hover {
  opacity: 0.9;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  font-size: 0.94rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 500;
}

.site-main {
  flex: 1;
  padding-top: 40px;
  padding-bottom: 56px;
}

/* Typography */

.page-title {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-lead {
  margin: 0 0 28px;
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

/* Cards / panels */

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
}

.panel h2,
.card h2 {
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 600;
}

/* Forms */

.field {
  margin-bottom: 14px;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
  color: var(--text);
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-subtle);
  color: var(--text);
}

input::placeholder {
  color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Buttons */

button,
.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

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

button:disabled,
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary,
button.primary {
  background: linear-gradient(180deg, #8b5cf6 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 1px 2px rgba(91, 33, 182, 0.2);
}

:root[data-theme="dark"] .primary,
:root[data-theme="dark"] button.primary {
  background: linear-gradient(180deg, #a78bfa 0%, #8b5cf6 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.secondary,
button.secondary {
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.success,
button.success {
  background: linear-gradient(180deg, #10b981 0%, var(--success) 100%);
  color: #fff;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2);
}

:root[data-theme="dark"] .success,
:root[data-theme="dark"] button.success {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.warning,
button.warning {
  background: linear-gradient(180deg, #fbbf24 0%, var(--warning) 100%);
  color: #422006;
  box-shadow: 0 1px 2px rgba(217, 119, 6, 0.2);
}

:root[data-theme="dark"] .warning,
:root[data-theme="dark"] button.warning {
  color: #1c1917;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.danger,
button.danger {
  background: linear-gradient(180deg, #f87171 0%, var(--danger) 100%);
  color: #fff;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
}

:root[data-theme="dark"] .danger,
:root[data-theme="dark"] button.danger {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.ghost,
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.ghost:hover:enabled,
button.ghost:hover:enabled {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--panel-hover);
}

/* Homepage */

.home-hero {
  margin-bottom: 40px;
}

.home-kicker {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.tool-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  text-decoration: none;
}

.tool-card h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 600;
}

.tool-card p {
  margin: 0;
  flex: 1;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.tool-card .tool-card__cta {
  margin-top: 18px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent-2);
}

.site-footer {
  margin-top: auto;
  padding: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .site-header__cluster {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .site-header {
    height: auto;
  }

  .site-main {
    padding-top: 28px;
  }
}
