/* ==========================================================================
   OinkDrop — main.css
   Foundation: design tokens, reset, typography, page shell, header, footer.
   Loaded on every page. "Dark glassmorphic luxury" — deep navy-charcoal base,
   frosted-glass panels, warm amber accent reserved for CTAs and highlights.
   ========================================================================== */

/* Century Gothic look, everywhere. Local Century Gothic is preferred where
   installed; Jost (a Futura-based geometric, near-identical) is the loaded
   web fallback so it stays consistent for visitors who don't have it. */
@import url('https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&display=swap');

/* ---------- Design tokens ---------- */
:root {
  --bg:          #1B2632;   /* base */
  --bg-2:        #2C3B4D;   /* raised */
  --bg-3:        #141D26;   /* deepest */
  --bg-deep:     #111922;   /* gradient tail */

  --accent:      #FFB162;   /* amber — CTA / glow / highlights */
  --accent-hi:   #FFD9AD;   /* warm highlight */
  --accent-2:    #A35139;   /* deep terracotta — secondary */

  --text:        #C9C1B1;   /* body text */
  --text-bright: #EEE9DF;   /* headings / bright */
  --text-dim:    rgba(201, 193, 177, 0.55);
  --text-faint:  rgba(201, 193, 177, 0.25);
  --line:        rgba(201, 193, 177, 0.14);   /* glass borders */

  /* glass surfaces */
  --glass:       linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  --glass-line:  inset 0 1px 0 rgba(255,255,255,0.1);

  --geo:         'Century Gothic', 'Jost', 'Futura', 'Twentieth Century', 'Trebuchet MS', sans-serif;
  --display:     var(--geo);   /* headings — was Fraunces */
  --body:        var(--geo);   /* body — was Inter */

  --max:         1440px;    /* legal / prose pages */
  --shell:       1240px;    /* landing + header/footer inner */
  --gutter:      clamp(24px, 5vw, 80px);
  --pad:         clamp(20px, 5vw, 28px);   /* shell horizontal padding */
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(180deg, #1B2632 0%, #141D26 60%, #111922 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--body);
  font-weight: 400;
  line-height: 1.55;
  overflow-x: hidden;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Subtle fixed grain overlay — no markup needed, applies to every page. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
/* Keep real content above the grain layer. */
.header, main, section, footer, .page-banner { position: relative; z-index: 2; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--accent); color: var(--bg-3); }

/* Visible keyboard focus everywhere. */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ==========================================================================
   Header  (sticky glass, shared across all pages)
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 29, 38, 0.6);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.55);
}
/* bottom hairline */
.header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(201,193,177,0.42) 28%, rgba(201,193,177,0.42) 72%, transparent 100%);
}
.header-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 17px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
/* Animated scroll-spy underline (landing only; JS positions it). */
.nav-underline {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  z-index: 1;
  transition: left 0.38s cubic-bezier(.4,.6,.15,1),
              width 0.38s cubic-bezier(.4,.6,.15,1),
              opacity 0.3s ease;
}

/* Logo — amber "drop" mark + wordmark */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--text-bright);
  transition: opacity 0.25s ease;
}
.logo:hover { opacity: 0.78; }
.logo em { font-style: normal; font-weight: 500; color: inherit; }
.logo-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 5px 5px 9px 5px;
  background: radial-gradient(120% 120% at 30% 25%, #FFD9AD, #FFB162 45%, #A35139 105%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
  display: block;
}

/* Nav */
.header-right { display: flex; align-items: center; gap: 32px; }
.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 13.5px;
  letter-spacing: 0.01em;
}
.nav a {
  color: var(--text);
  transition: color 0.25s ease;
}
.nav a:hover { color: var(--text-bright); }
.nav a.current { color: var(--accent); }

/* "Browse" pill in the nav */
.btn-pill,
.nav a.btn-pill,
.nav a.btn-pill:hover {
  color: #241a12;
}
.btn-pill {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 5px;
  background: linear-gradient(180deg, #FFC98F, #FFB162);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.2s ease, filter 0.2s ease;
}
.btn-pill:hover { transform: translateY(-1px); filter: brightness(1.07); }
.btn-pill:active { transform: translateY(0); filter: brightness(0.97); }

/* Mobile menu toggle */
.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }
.menu-toggle { display: none; }

/* ==========================================================================
   Buttons
   ========================================================================== */
/* Primary amber CTA — used on the landing hero and project cards. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  padding: 15px 26px;
  border-radius: 6px;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease,
              background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  color: #241a12;
  background: linear-gradient(180deg, #FFCE97, #FFB162);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  filter: brightness(1.03);
}
.btn-primary:active { transform: translateY(0); filter: brightness(0.97); }
.btn-ghost {
  color: var(--text-bright);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Inline text link with sliding arrow. */
.link-arrow {
  display: inline-block;
  font-size: 14.5px;
  color: rgba(201, 193, 177, 0.85);
  transition: transform 0.22s ease, color 0.22s ease;
}
.link-arrow:hover { transform: translateX(3px); color: var(--text-bright); }
.link-arrow.accent { color: var(--accent); }
.link-arrow.accent:hover { color: var(--accent-hi); }

/* Per-project accent override (set via --proj-accent on .project-slide, CMS "Card accent" field) */
.project-copy .btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--proj-accent, var(--accent)) 65%, white), var(--proj-accent, var(--accent)));
}
.project-copy .link-arrow.accent { color: var(--proj-accent, var(--accent)); }
.project-copy .link-arrow.accent:hover { color: color-mix(in srgb, var(--proj-accent, var(--accent)) 80%, white); }

/* ==========================================================================
   Footer  (glass panel, shared across all pages)
   ========================================================================== */
.footer {
  border-top: 1px solid var(--line);
  background: rgba(20, 29, 38, 0.4);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
}
.footer-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 56px var(--pad) 44px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(201, 193, 177, 0.1);
}
.footer-brand .logo { font-size: 19px; margin-bottom: 20px; }
.footer-brand h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-bright);
  margin: 0 0 18px;
  max-width: 18ch;
}
.footer-brand h3 em { font-style: italic; font-weight: 400; color: var(--accent); }
.footer-brand p {
  font-size: 14px;
  color: var(--text-dim);
  max-width: 40ch;
  margin-bottom: 24px;
}
/* Newsletter — rounded field + solid amber button. */
.newsletter {
  display: flex;
  gap: 10px;
  max-width: 380px;
}
.newsletter input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 6px;
  border: 1px solid rgba(201, 193, 177, 0.18);
  background: rgba(20, 29, 38, 0.6);
  color: var(--text-bright);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.newsletter input::placeholder { color: rgba(201, 193, 177, 0.4); }
.newsletter input:focus {
  border-color: rgba(255, 177, 98, 0.6);
  background: rgba(20, 29, 38, 0.85);
}
.newsletter button {
  white-space: nowrap;
  padding: 13px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  color: #241a12;
  background: linear-gradient(180deg, #FFCE97, #FFB162);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.newsletter button:hover { transform: translateY(-1px); filter: brightness(1.07); }
.newsletter button:active { transform: translateY(0); filter: brightness(0.97); }

.footer-col h4 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(201, 193, 177, 0.45);
  margin-bottom: 20px;
  font-weight: 600;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 13px; }
.footer-col a {
  font-size: 14px;
  color: rgba(201, 193, 177, 0.8);
  transition: color 0.2s ease, padding 0.2s ease;
  display: inline-block;
}
.footer-col a:hover { color: var(--text-bright); padding-left: 4px; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-copy {
  font-size: 12px;
  color: rgba(201, 193, 177, 0.4);
  letter-spacing: 0.08em;
}
.footer-socials { display: flex; gap: 12px; }
.footer-socials .icon-btn { width: 40px; height: 40px; border-radius: 8px; }

/* ==========================================================================
   Back-to-top button  (injected by main.js, present on every page)
   ========================================================================== */
.to-top {
  position: fixed;
  right: clamp(16px, 4vw, 32px);
  bottom: clamp(16px, 4vw, 32px);
  z-index: 60;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  border: 1px solid var(--line);
  background: rgba(20, 29, 38, 0.6);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: var(--glass-line), 0 12px 30px -14px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.2s ease, color 0.2s ease;
}
.to-top.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.to-top:hover {
  border-color: rgba(255, 177, 98, 0.5);
  color: var(--accent-hi);
  transform: translateY(-2px);
}
.to-top svg { width: 18px; height: 18px; }

/* ==========================================================================
   Scroll-reveal animations
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  .nav { display: none; }
  .nav.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px var(--pad) 28px;
    background: rgba(20, 29, 38, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
  }
  .nav.open .btn-pill { align-self: stretch; justify-content: center; }
  .menu-toggle { display: grid; }
  .nav-underline { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { justify-content: flex-start; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}
