/* ==========================================================================
   The Twisted Squid Trading Co. — design tokens
   Palette:
     --abyss        #0a0d10   deep sea black (background)
     --abyss-2      #10151a   raised panel black
     --bone         #d9cfb8   parchment/bone (body text)
     --bone-dim     #9c9484   muted bone (secondary text)
     --brass        #b3893f   weathered brass (accent / links)
     --brass-bright #d9ad5c   brass hover
     --rust         #7a2e22   old blood / rust (CTA)
     --rust-bright  #9c3c2c   rust hover
     --kelp         #1f332e   deep kelp green (panels, borders)
   Type:
     display: 'Cinzel' (carved, monumental — ship's nameplate lettering)
     body:    'EB Garamond' (period-appropriate serif, readable)
     utility: 'IBM Plex Mono' (ship's log stamps, coordinates, labels)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --abyss: #0a0d10;
  --abyss-2: #10151a;
  --bone: #d9cfb8;
  --bone-dim: #9c9484;
  --brass: #b3893f;
  --brass-bright: #d9ad5c;
  --rust: #7a2e22;
  --rust-bright: #9c3c2c;
  --kelp: #1f332e;
  --border: rgba(179, 137, 63, 0.25);
  --max-w: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--abyss);
  color: var(--bone);
  font-family: 'EB Garamond', serif;
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.04em;
  color: var(--bone);
  margin: 0 0 0.5em;
  font-weight: 600;
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  display: inline-block;
  margin-bottom: 0.9rem;
}

a { color: var(--brass-bright); text-decoration: none; }
a:hover { color: var(--rust-bright); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brass-bright);
  outline-offset: 3px;
}

img { max-width: 100%; display: block; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* ---- rope divider (signature motif) ---- */
.rope-divider {
  width: 100%;
  height: 18px;
  margin: 0 auto;
  opacity: 0.55;
}

/* ---- header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 13, 16, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  object-fit: cover;
}
.brand-name {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--bone);
}
.brand-name small {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--brass);
  font-weight: 400;
}
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nav-links a { color: var(--bone-dim); }
.nav-links a.active, .nav-links a:hover { color: var(--brass-bright); }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--abyss-2);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { max-height: 300px; }
  .nav-links li { border-top: 1px solid var(--border); }
  .nav-links a { display: block; padding: 1rem 1.5rem; }
  .nav-toggle {
    display: block;
    background: none;
    border: 1px solid var(--border);
    color: var(--bone);
    font-family: 'IBM Plex Mono', monospace;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
  }
}

/* ---- hero ---- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: saturate(0.85) contrast(1.05);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,13,16,0.15) 0%, rgba(10,13,16,0.55) 55%, rgba(10,13,16,0.97) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 1.5rem 4.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.05;
  max-width: 14ch;
  text-shadow: 0 4px 24px rgba(0,0,0,0.6);
}
.hero p.lede {
  max-width: 46ch;
  font-size: 1.2rem;
  color: var(--bone-dim);
  font-style: italic;
  margin: 1rem 0 2rem;
}
.hero-coords {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--brass);
  margin-top: 2.5rem;
}

/* ---- buttons ---- */
.btn {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9rem 1.8rem;
  border: 1px solid var(--brass);
  color: var(--bone);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { background: var(--brass); color: var(--abyss); }
.btn-solid {
  background: var(--rust);
  border-color: var(--rust);
  color: var(--bone);
}
.btn-solid:hover { background: var(--rust-bright); border-color: var(--rust-bright); color: var(--bone); }
.btn-outline { border-color: var(--bone-dim); color: var(--bone); }
.btn-outline:hover { background: var(--bone-dim); border-color: var(--bone-dim); color: var(--abyss); }

/* ---- sections ---- */
section { padding: 5.5rem 0; }
.section-alt { background: var(--abyss-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 62ch; margin-bottom: 3rem; }
.section-head p { color: var(--bone-dim); font-size: 1.08rem; }

/* ---- log entries (signature card motif) ---- */
.log-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.log-entry {
  background: var(--abyss);
  padding: 2.2rem 2rem;
}
.log-stamp {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--brass);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}
.log-entry h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.log-entry p { color: var(--bone-dim); font-size: 1rem; margin: 0; }

@media (max-width: 820px) {
  .log-grid { grid-template-columns: 1fr; }
}

/* ---- two-col layout ---- */
.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
  align-items: center;
}
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
}
.split img { border: 1px solid var(--border); }

/* ---- quote / legend block ---- */
.legend {
  border-left: 2px solid var(--rust);
  padding-left: 1.8rem;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--bone);
  margin: 2rem 0;
}
.legend cite {
  display: block;
  margin-top: 0.8rem;
  font-family: 'IBM Plex Mono', monospace;
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brass);
}

/* ---- timeline (used sparingly, only where order is real) ---- */
.timeline { border-left: 1px solid var(--border); margin-left: 0.4rem; }
.timeline-item { position: relative; padding: 0 0 2.4rem 2rem; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px; top: 4px;
  width: 9px; height: 9px;
  background: var(--brass);
  border-radius: 50%;
}
.timeline-item .year {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--brass);
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: 0.4rem;
}

/* ---- forms ---- */
.form-panel {
  background: var(--abyss-2);
  border: 1px solid var(--border);
  padding: 2.5rem;
}
.field { margin-bottom: 1.4rem; }
.field label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.5rem;
}
.field input, .field textarea {
  width: 100%;
  background: var(--abyss);
  border: 1px solid var(--border);
  color: var(--bone);
  font-family: 'EB Garamond', serif;
  font-size: 1.05rem;
  padding: 0.75rem 0.9rem;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--brass); }
.form-note { font-size: 0.85rem; color: var(--bone-dim); margin-top: 1rem; }

.alert {
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  margin-bottom: 1.8rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.alert-success { border-color: var(--kelp); background: rgba(31,51,46,0.4); color: var(--bone); }
.alert-error { border-color: var(--rust); background: rgba(122,46,34,0.2); color: var(--bone); }

/* ---- contact grid ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
}
@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.detail-row { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.detail-row:first-child { padding-top: 0; }
.detail-row .label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.3rem;
}

/* ---- footer ---- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  background: var(--abyss-2);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}
.footer-note {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--bone-dim);
}

/* ---- mobile ---- */
@media (max-width: 600px) {
  body { font-size: 17px; }
  section { padding: 3.5rem 0; }
  .form-panel { padding: 1.5rem; }
  .log-entry { padding: 1.75rem 1.5rem; }
  .hero { min-height: 72vh; }
  .hero-content { padding-bottom: 3rem; }
  .legend { font-size: 1.1rem; padding-left: 1.2rem; }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
