/* ============================================================
   Petrarch Marketplace — Landing page
   Implements the Figma "landing page #2" design.
   Self-contained: this page does NOT load the shared (dark)
   styles.css, so it can't regress the other marketplace pages.
   ============================================================ */

/* ---- Design tokens (light) ---------------------------------- */
:root {
  --bg:        #fff8f5;   /* warm cream page background        */
  --surface:   #fbf2ed;   /* cards, footer                    */
  --border:    #e9e1dc;   /* hairlines, card borders          */
  --ink:       #012d1d;   /* headings, logo, primary green    */
  --ink-2:     #615e57;   /* body copy, nav links             */
  --accent:    #1b4332;   /* dashboard button, underline      */
  --pill-bg:   #c1ecd4;   /* "Backed by YC" pill background   */
  --pill-ink:  #274e3d;   /* "Backed by YC" pill text         */

  --btn-bg:    #012d1d;   /* primary button fill              */
  --btn-ink:   #ffffff;   /* primary button text              */
  --glow:      rgba(165, 208, 185, 0.30);  /* hero radial glow */

  --font-serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --font-sans:  "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --maxw: 1280px;
}

/* ---- Design tokens (dark) — applied via .dark on <html> ----- */
html.dark {
  --bg:        #0b1a13;
  --surface:   #102a20;
  --border:    #1e3b2e;
  --ink:       #f1ede6;
  --ink-2:     #a7b6ac;
  --accent:    #2f6b4f;
  --pill-bg:   #1e3b2e;
  --pill-ink:  #c1ecd4;

  --btn-bg:    #c1ecd4;
  --btn-ink:   #06140e;
  --glow:      rgba(110, 170, 135, 0.20);
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink-2);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }

img, svg { display: block; }

/* ============================================================
   PASSWORD GATE
   ============================================================ */
#gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}
#gate.hidden { display: none; }

.gate-box {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.gate-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.gate-logo svg {
  width: 30px;
  height: 30px;
  color: #fff;
}
.gate-logo .badge {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gate-logo-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
  color: var(--ink);
}

.gate-label {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.6;
}

.gate-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#gate-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color .15s ease;
}
#gate-input:focus { border-color: var(--accent); }
#gate-input.error { border-color: #c0392b; animation: shake .35s; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.gate-error {
  min-height: 16px;
  font-size: 12px;
  color: #c0392b;
}

.gate-btn {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity .15s ease;
}
.gate-btn:hover { opacity: .9; }
.gate-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   NAV
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  padding: 16px 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.nav-inner .brand { justify-self: start; }
.nav-inner .nav-links { justify-self: center; }
.nav-inner .nav-actions { justify-self: end; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
  line-height: 32px;
  color: var(--ink);
}
.brand-logo {
  height: 30px;
  width: auto;
  color: var(--ink);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--ink-2);
  transition: color .15s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--ink); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  border-radius: 6px;
  transition: background-color .15s ease, color .15s ease;
}
.theme-toggle:hover { background: var(--surface); color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
html.dark .theme-toggle .icon-moon { display: none; }
html.dark .theme-toggle .icon-sun { display: block; }

.link-login {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 8px 12px;
  transition: color .15s ease;
}
.link-login:hover { color: var(--ink); }

/* ---- Buttons (shared) — sharp corners per design ----------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 0;
  transition: opacity .15s ease, background-color .2s ease, color .2s ease;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  padding: 8px 24px;
}
.btn-accent:hover { opacity: .9; }

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.35px;
  padding: 17px 40px;
  min-width: 180px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}
.btn-primary:hover { opacity: .92; }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.35px;
  padding: 16px 40px;
  min-width: 180px;
}
.btn-outline:hover { background: var(--ink); color: var(--bg); }

/* ============================================================
   MAIN / DECORATIVE BACKGROUND
   ============================================================ */
.main {
  position: relative;
  flex: 1 0 auto;
  overflow: hidden;
}

/* faint constellation glow behind the hero (matches Figma) */
.bg-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 42%, var(--glow) 0%, transparent 55%);
}
.bg-decor::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image: radial-gradient(var(--border) 1px, transparent 1.4px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 50% 38%, #000 0%, transparent 60%);
          mask-image: radial-gradient(circle at 50% 38%, #000 0%, transparent 60%);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  z-index: 1;
  max-width: 896px;
  margin: 0 auto;
  padding: 104px 24px 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  background: var(--pill-bg);
  color: var(--pill-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  padding: 4px 16px;
  border-radius: 12px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--ink);
  font-size: clamp(32px, 4.6vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.032em;
  margin-top: 40px;
  max-width: 760px;
}
.hero h1 em {
  font-style: italic;
  font-weight: 700;
}

.hero-sub {
  margin-top: 24px;
  max-width: 660px;
  font-size: 18px;
  line-height: 1.62;
  color: var(--ink-2);
}
.hero-sub strong { font-weight: 700; color: var(--ink-2); }

.hero-cta {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.how {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 64px 96px;
}

.how-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}
.how-head h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 32px;
  line-height: 40px;
  color: var(--ink);
  text-align: center;
}
.how-rule {
  width: 64px;
  height: 4px;
  background: var(--accent);
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.pillar {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 33px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pillar .p-icon {
  color: var(--ink);
  height: 22px;
  display: flex;
  align-items: center;
}
.pillar .p-icon svg { height: 20px; width: auto; }
.pillar h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 24px;
  line-height: 32px;
  color: var(--ink);
}
.pillar p {
  font-size: 16px;
  line-height: 26px;
  color: var(--ink-2);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.footer-inner {
  padding: 32px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand .brand { display: block; }
.footer-copy {
  margin-top: 8px;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-2);
}
.footer-links {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.96px;
  color: var(--ink-2);
  transition: color .15s ease;
}
.footer-links a:hover { color: var(--ink); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav-inner { padding: 16px 24px; }
  .how { padding: 24px 24px 72px; }
  .footer-inner { padding: 28px 24px; }
  .pillars { grid-template-columns: 1fr; gap: 20px; }
  .nav-links { display: none; }
}

@media (max-width: 560px) {
  .hero { padding: 64px 20px 64px; }
  .hero-cta { flex-direction: column; align-self: stretch; }
  .hero-cta .btn { width: 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
