/* Koirala Studio — shared styles */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT,WONK@0,9..144,300..900,0..100,0..1;1,9..144,300..900,0..100,0..1&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #F4EFE6;
  --bg-card: #EBE4D6;
  --ink: #1B1A17;
  --ink-soft: #3A3631;
  --muted: #6B6359;
  --accent: #B5482E;
  --accent-soft: #D9694B;
  --border: #D4CCBD;
  --rule: #C9C0AE;

  --serif: 'Fraunces', 'Iowan Old Style', 'Hoefler Text', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --max: 720px;
  --pad: clamp(1.25rem, 4vw, 2rem);
}

[data-theme="dark"] {
  --bg: #1B1A17;
  --bg-card: #25221E;
  --ink: #F0EBE0;
  --ink-soft: #C9C2B5;
  --muted: #948A7E;
  --accent: #D9694B;
  --accent-soft: #E8836A;
  --border: #3A3530;
  --rule: #2D2926;
}

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: 'ss01', 'ss02';
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Subtle paper texture using SVG noise — gives warmth without weight */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0.05 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

[data-theme="dark"] body::before {
  opacity: 0.6;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.9 0 0 0 0 0.85 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  border-bottom: 1px solid currentColor;
  transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
  opacity: 0.7;
}

a.plain {
  color: var(--ink);
  border-bottom-color: transparent;
}

a.plain:hover {
  color: var(--accent);
}

/* Layout */

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  width: 100%;
}

main {
  flex: 1;
  padding-top: clamp(2rem, 6vw, 3.5rem);
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem 0;
}

.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.site-header .brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  border: none;
}

.site-header .brand em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.site-header .meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s ease;
  text-transform: uppercase;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Typography */

h1, h2, h3 {
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

.hero h1 {
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
  font-variation-settings: "SOFT" 100;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  margin: 2.5rem 0 1rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 500;
  margin: 1.75rem 0 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--ink-soft);
}

p.lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 36em;
  line-height: 1.55;
}

.hero {
  padding: clamp(1rem, 4vw, 2.5rem) 0 clamp(2.5rem, 6vw, 4rem);
}

/* Section labels — small monospace caps */

.section-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::before {
  content: '';
  width: 1.5rem;
  height: 1px;
  background: var(--rule);
}

/* App list — editorial, not card-grid */

.app-list {
  list-style: none;
  border-top: 1px solid var(--rule);
}

.app-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: baseline;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.app-row:hover .app-name {
  color: var(--accent);
}

.app-row:hover .app-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

.app-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  padding-top: 0.35rem;
  min-width: 2.5rem;
}

.app-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.app-name {
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.app-status {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 2px;
  font-weight: 500;
  white-space: nowrap;
}

.app-status.live {
  background: var(--accent);
  color: var(--bg);
}

.app-status.soon {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--rule);
}

.app-status.dev {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.app-desc {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.5;
  font-style: italic;
}

.app-link {
  display: contents;
}

.app-link, .app-link.plain {
  border: none;
}

.app-arrow {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.95rem;
  padding-top: 0.5rem;
  transition: transform 0.2s ease, color 0.15s ease;
}

.app-row.no-link {
  cursor: default;
}

.app-row.no-link:hover .app-name {
  color: var(--ink);
}

/* Coda — bottom note */

.coda {
  margin-top: 2.5rem;
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
}

/* Coming soon banner on app pages */

.coming-soon {
  margin: 2rem 0;
  padding: 2rem;
  border: 1px dashed var(--rule);
  border-radius: 3px;
  text-align: center;
  background: var(--bg-card);
}

.coming-soon .badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-block;
  margin-bottom: 0.5rem;
}

.coming-soon p {
  font-size: 1rem;
  color: var(--ink-soft);
  margin-bottom: 0;
}

/* Long-form content (privacy, terms) */

.prose h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 0.75rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.prose h3 {
  font-size: 1.05rem;
  font-weight: 500;
  margin: 1.5rem 0 0.5rem;
  color: var(--ink);
}

.prose p, .prose ul, .prose ol {
  margin-bottom: 1rem;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.65;
}

.prose ul, .prose ol {
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose strong {
  color: var(--ink);
  font-weight: 500;
}

.prose .timestamp {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
  letter-spacing: 0.03em;
}

.prose .legal-quote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 2px solid var(--accent);
  background: var(--bg-card);
  font-size: 0.95rem;
  font-style: italic;
}

/* Back link */

.back-link {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.back-link:hover {
  color: var(--accent);
  opacity: 1;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.75rem 0;
  margin-top: auto;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.site-footer nav {
  display: flex;
  gap: 1.5rem;
}

.site-footer a {
  color: var(--muted);
  border: none;
}

.site-footer a:hover {
  color: var(--accent);
  opacity: 1;
}

/* Support page extras */

.contact-block {
  padding: 1.75rem;
  background: var(--bg-card);
  border-radius: 3px;
  border: 1px solid var(--border);
  margin: 1.5rem 0 2.5rem;
}

.contact-block .label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.contact-block .email {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.faq-item {
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.faq-item p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* 404 page */

.notfound {
  text-align: center;
  padding: 4rem 0;
}

.notfound .num {
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 300;
  font-style: italic;
  color: var(--accent);
  line-height: 1;
  font-variation-settings: "SOFT" 100;
}

.notfound h1 {
  font-size: 1.5rem;
  font-weight: 400;
  margin: 1rem 0 0.5rem;
}

.notfound p {
  color: var(--muted);
  margin-bottom: 2rem;
}

/* Mobile refinements */

@media (max-width: 540px) {
  body { font-size: 16px; }

  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .site-header .meta {
    font-size: 0.68rem;
  }

  .app-row {
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
  }

  .app-num {
    display: none;
  }

  .app-name {
    font-size: 1.2rem;
  }

  .site-footer .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .site-footer nav {
    flex-wrap: wrap;
    gap: 1rem;
  }
}

/* Reduce motion */

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