/*
 * Polymath360Studio — legal pages (privacy-policy.html, terms-of-service.html)
 *
 * The homepage keeps its styles inline in index.html. This file restates the
 * homepage tokens, brand lockup and footer so the legal pages match it. Keep
 * the values below in step with the :root block in index.html.
 */

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

:root {
  --black: #101307;
  --deep: #171b0b;
  --card: #20240f;
  --border: rgba(229, 197, 104, 0.18);
  --gold: #d5a62f;
  --gold-lt: #f0cf72;
  --white: #f7f4ec;
  --muted: #d1cfbf;
  --serif: 'Cormorant Garamond', serif;
  --sans: 'Outfit', sans-serif;
  --wordmark: 'Anton', sans-serif;
}

body {
  background:
    radial-gradient(circle at 85% 5%, rgba(103, 113, 5, 0.26), transparent 34rem),
    radial-gradient(circle at 10% 38%, rgba(191, 137, 29, 0.1), transparent 30rem),
    linear-gradient(145deg, #101307 0%, #181b0b 48%, #222608 100%);
  background-color: var(--black);
  background-attachment: fixed;
  color: var(--white);
  font-family: var(--sans);
  font-weight: 300;
  overflow-x: hidden;
}

/* NOISE OVERLAY */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
}

.legal-header,
.legal-main,
footer {
  position: relative;
  z-index: 2;
}

a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* HEADER */
.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 60px;
  border-bottom: 1px solid var(--border);
  background: rgba(16, 19, 7, 0.92);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-img {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 0 16px rgba(201, 151, 58, 0.35), 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.3s, transform 0.3s;
}

.nav-logo:hover .nav-logo-img {
  box-shadow: 0 0 28px rgba(201, 151, 58, 0.6), 0 4px 14px rgba(0, 0, 0, 0.5);
  transform: scale(1.05);
}

.nav-logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-logo-name,
.footer-logo {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  font-family: var(--wordmark);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--white);
  -webkit-text-stroke: 0.5px #050603;
  text-shadow: 0 2px 0 #050603, 0 0 18px rgba(213, 166, 47, 0.2);
  line-height: 1;
}

.nav-logo-name .brand-accent,
.footer-logo .brand-accent {
  color: #ffd20a;
}

.nav-logo-tag {
  font-family: var(--serif);
  font-size: 0.78rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.04em;
  color: rgba(232, 194, 122, 0.9);
  line-height: 1;
}

.legal-back {
  color: #c0c0d4;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s;
}

.legal-back:hover {
  color: var(--gold);
}

/* CONTENT */
.legal-main {
  max-width: 820px;
  margin: 0 auto;
  padding: 90px 30px 100px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}

.section-label::before {
  content: '';
  display: block;
  width: 30px;
  height: 1px;
  background: var(--gold);
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--white);
}

.section-title strong {
  font-weight: 600;
  color: var(--gold);
}

.legal-updated {
  margin-top: 18px;
  font-size: 0.85rem;
  color: #a0a0b8;
}

.legal-intro {
  margin-top: 28px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: #e8e8f5;
}

.legal-toc {
  margin-top: 40px;
  padding: 26px 30px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(42, 46, 18, 0.94), rgba(25, 29, 11, 0.96));
}

.legal-toc-title {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 14px;
}

.legal-toc ol {
  padding-left: 1.3em;
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.legal-toc a {
  color: #e8e8f5;
  text-decoration: none;
  transition: color 0.3s;
}

.legal-toc a:hover {
  color: var(--gold);
}

.legal-section {
  margin-top: 56px;
  scroll-margin-top: 24px;
}

.legal-section h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--white);
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.legal-section h3 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-lt);
  margin: 30px 0 12px;
}

.legal-section p,
.legal-section li {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--muted);
}

.legal-section p + p,
.legal-section p + ul,
.legal-section ul + p {
  margin-top: 14px;
}

.legal-section ul {
  padding-left: 1.3em;
  display: grid;
  gap: 8px;
}

.legal-section li::marker {
  color: var(--gold);
}

.legal-section strong {
  color: var(--white);
  font-weight: 500;
}

.legal-section a {
  color: var(--gold-lt);
  text-decoration: underline;
  text-decoration-color: rgba(240, 207, 114, 0.4);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  transition: color 0.3s, text-decoration-color 0.3s;
}

.legal-section a:hover {
  color: var(--white);
  text-decoration-color: var(--gold);
}

.legal-section code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: var(--gold-lt);
  background: rgba(213, 166, 47, 0.08);
  border: 1px solid var(--border);
  padding: 2px 6px;
  overflow-wrap: anywhere;
}

.legal-note {
  margin-top: 20px;
  padding: 18px 22px;
  border-left: 2px solid var(--gold);
  background: rgba(213, 166, 47, 0.06);
}

.legal-contact {
  list-style: none;
  padding-left: 0 !important;
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 0 60px;
  background:
    radial-gradient(circle at 85% 20%, rgba(91, 100, 5, 0.13), transparent 32rem),
    linear-gradient(135deg, #171b0b, #20230e);
}

.footer-bottom {
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 28px;
}

.footer-copy {
  font-size: 0.82rem;
  color: #a0a0b8;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-right: auto;
}

.footer-legal a {
  display: inline-block;
  padding: 4px 0;
  font-size: 0.85rem;
  color: #d0d0e4;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.3s;
}

.footer-legal a:hover,
.footer-legal a[aria-current="page"] {
  color: var(--gold);
}

.footer-tagline-bottom {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.88rem;
  color: rgba(201, 151, 58, 0.92);
}

/* SHARED SECONDARY-PAGE COMPONENTS — used by naam-o-nisha.html and 404.html.
   Buttons and cards restate the homepage components; type values come from the homepage scale. */
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
}

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 16px 40px;
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--gold);
  color: var(--black);
  font-weight: 600;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--white);
  transform: translateX(-101%);
  transition: transform 0.3s;
}

.btn-primary:hover::after {
  transform: translateX(0);
}

.btn-primary span {
  position: relative;
  z-index: 1;
}

.btn-secondary {
  border: 1px solid rgba(240, 237, 232, 0.25);
  color: var(--white);
  font-weight: 400;
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  margin-top: 28px;
}

.info-card {
  padding: 32px 28px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(42, 46, 18, 0.94), rgba(25, 29, 11, 0.96));
}

.legal-section .info-card h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.3;
  color: var(--white);
  margin: 0 0 12px;
}

.status-tag {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 14px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid rgba(201, 151, 58, 0.3);
  color: var(--gold);
}

.status-tag.is-dev {
  color: var(--gold-lt);
  border-color: rgba(240, 207, 114, 0.6);
}

.legal-section .legal-note + p,
.legal-section .page-actions + p {
  margin-top: 20px;
}

/* ACCESSIBILITY */
:focus-visible {
  outline: 2px solid var(--gold-lt);
  outline-offset: 3px;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .legal-header {
    padding: 12px 24px;
  }

  footer {
    padding: 0 30px;
  }
}

@media (max-width: 600px) {
  .nav-logo-img {
    width: 46px;
    height: 46px;
  }

  .nav-logo-name {
    font-size: 1.05rem;
  }

  .nav-logo-tag {
    display: none;
  }

  .legal-header {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .legal-back {
    font-size: 0.72rem;
  }

  .legal-main {
    padding: 56px 20px 72px;
  }

  .legal-toc {
    padding: 22px 20px;
  }

  footer {
    padding: 0 24px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .footer-tagline-bottom {
    font-size: 0.85rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .page-actions a {
    width: 100%;
    text-align: center;
  }
}

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