/* =========================================================
   Aacoustic — Modern white theme (dashboard)
   ========================================================= */

:root {
  /* Color tokens */
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-subtle: #f8fafc;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;

  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-text-soft: #64748b;

  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-soft: #eff6ff;
  --color-accent: #0ea5e9;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.18);

  /* Geometry */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Layout */
  --container-max: 1180px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

img { max-width: 100%; height: auto; display: block; }

/* =========================================================
   Header
   ========================================================= */
.site-header {
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface-subtle) 100%);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px clamp(16px, 4vw, 40px);
  width: 100%;
  max-width: 100%;
  margin: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(8px);
}

.title-container {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.title-container h1 {
  margin: 0;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.app-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: contain;
  display: block;
}

.lang-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

.lang-selector .flag {
  height: 22px;
  width: 22px;
  object-fit: cover;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  border: 1px solid var(--color-border);
}

.lang-selector .flag:hover {
  transform: scale(1.1);
  box-shadow: var(--ring);
}

.lang-selector .flag:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  transform: scale(1.05);
}

/* =========================================================
   Hero / intro
   ========================================================= */
.hero {
  max-width: var(--container-max);
  margin: 48px auto 8px;
  padding: 0 clamp(16px, 4vw, 40px);
  text-align: center;
}

.hero h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.hero p {
  color: var(--color-text-muted);
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  max-width: 640px;
  margin: 0 auto;
}

/* =========================================================
   Tool grid
   ========================================================= */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  width: 100%;
  max-width: var(--container-max);
  margin: 32px auto 64px;
  padding: 0 clamp(16px, 4vw, 40px);
}

.tool-card {
  position: relative;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
  padding: 28px 22px;
  cursor: pointer;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease),
    border-color 0.22s var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  color: var(--color-text);
  overflow: hidden;
  isolation: isolate;
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-primary-soft) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  z-index: -1;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.tool-card:hover::before { opacity: 1; }

.tool-card:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md), var(--ring);
}

.tool-card img {
  width: auto;
  max-height: 110px;
  max-width: 70%;
  object-fit: contain;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.06));
  transition: transform 0.3s var(--ease);
}

.tool-card:hover img { transform: scale(1.04); }

.tool-card h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 8px 0 6px;
  color: var(--color-text);
  letter-spacing: -0.005em;
}

.tool-desc {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.45;
}

.tool-card.disabled {
  pointer-events: none;
  opacity: 0.45;
  cursor: not-allowed;
}

/* Decorative arrow on hover */
.tool-card::after {
  content: "→";
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 18px;
  color: var(--color-primary);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.tool-card:hover::after,
.tool-card:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 20px clamp(16px, 4vw, 40px);
  text-align: center;
  color: var(--color-text-soft);
  font-size: 0.85rem;
  background: var(--color-surface-subtle);
}

.site-footer a {
  color: var(--color-primary);
  text-decoration: none;
}

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

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 640px) {
  .site-header {
    padding: 14px 16px;
    border-radius: 0;
  }
  .title-container h1 { font-size: 1.05rem; }
  .tool-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 24px;
  }
  .hero { margin-top: 32px; }
  .tool-card { padding: 22px 18px; }
}

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