/* Codenza.app — Same feel as divyendra.com: Newsreader + Inter, clean layout */

:root {
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --border: #e8e8e8;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --max-width: 680px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: "Newsreader", Georgia, "Times New Roman", serif;
  --radius: 10px;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.08);
  --selection-bg: rgba(37, 99, 235, 0.15);
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--selection-bg);
  color: var(--text);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(to bottom, var(--bg-subtle) 0%, var(--bg) 12rem);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.site {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 48px;
}

/* Header */
.site-header {
  padding: 20px 0 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease, letter-spacing 0.2s ease;
}

.site-title a:hover {
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.01em;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
  border-bottom-color: var(--border);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text);
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }
  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 16px;
  }
  .site-nav.is-open {
    display: flex;
  }
}

/* Hero — title on top, then logo left + content right */
.hero {
  padding: 32px 0 28px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 0 0 24px;
  color: var(--text);
  letter-spacing: 0.01em;
  text-align: center;
}

@media (min-width: 560px) {
  .hero-title {
    font-size: 1.65rem;
  }
}

.hero-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px 28px;
  align-items: start;
}

@media (min-width: 560px) {
  .hero-row {
    grid-template-columns: auto 1fr;
    gap: 24px 32px;
  }
}

.hero-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  display: block;
}

@media (min-width: 560px) {
  .hero-logo {
    width: 120px;
    height: 120px;
  }
}

.hero-intro {
  text-align: left;
  min-width: 0;
}

.hero-intro p {
  margin: 0 0 0.65em;
  color: var(--text);
  font-weight: 300;
}

.hero-intro p:last-child {
  margin-bottom: 0;
}

.hero-intro a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 2px;
}

.hero-intro a:hover {
  text-decoration: underline;
}

/* Section */
.section-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0 0 16px;
  color: var(--text);
  text-align: center;
}

.section-title::before {
  content: "•••";
  display: block;
  margin-bottom: 10px;
  letter-spacing: 0.35em;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.85;
}

.section {
  padding: 20px 0;
}

.section-lead {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-weight: 300;
  text-align: center;
}

.why-block {
  padding: 16px 0;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}

.why-block:hover {
  background: rgba(0, 0, 0, 0.02);
}

.why-block p {
  margin: 0 0 0.65em;
  color: var(--text);
  font-weight: 300;
}

.why-block p:last-child {
  margin-bottom: 0;
}

/* App card */
.app-card {
  padding: 20px 0;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}

.app-card:hover {
  background: rgba(0, 0, 0, 0.02);
}

.app-card p {
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 300;
}

.app-rating {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 12px !important;
}

.app-card .button {
  display: inline-block;
  color: var(--link);
  text-decoration: none;
  font-size: 15px;
  margin-top: 8px;
}

.app-card .button:hover {
  text-decoration: underline;
}

.app-card .button-cta {
  display: inline-block;
  padding: 10px 18px;
  margin-top: 8px;
  background: var(--link);
  color: #fff !important;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.app-card .button-cta:hover {
  background: var(--link-hover);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.learning-links a,
.hero-intro a,
#contact a {
  text-underline-offset: 2px;
}

.app-card .note {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
}

/* Learning links */
.learning-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.learning-links li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 300;
  transition: padding-left 0.2s ease;
}

.learning-links li:hover {
  padding-left: 6px;
}

.learning-links li:last-child {
  border-bottom: none;
}

.learning-links a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 2px;
}

.learning-links a:hover {
  text-decoration: underline;
}

/* Contact */
#contact p {
  margin: 0;
  font-weight: 300;
}

#contact a {
  color: var(--link);
  text-decoration: none;
}

#contact a:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 32px 0 40px;
  font-size: 13px;
  font-weight: 300;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
}

.site-footer a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 2px;
}

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

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 12px 20px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 400;
  text-decoration: none;
  border: 2px solid var(--link);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* 404 / error page */
.error-main {
  padding: 48px 0;
  text-align: center;
}

.error-text {
  margin: 0 0 24px;
  color: var(--text-muted);
}

.error-main .button-cta {
  color: #fff;
  text-decoration: none;
}

.error-main .button-cta:hover {
  text-decoration: none;
  color: #fff;
}

/* Print */
@media print {
  .nav-toggle,
  .site-nav {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .site {
    max-width: 100%;
  }
  a[href^="http"]:not([href*="codenza.app"])::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #666;
  }
}
