/* ==========================================================
   Sterlacci Capital — Roman / travertine & bronze palette
   ========================================================== */
:root {
  --travertine: #f4efe6;
  --marble:     #faf8f3;
  --stone:      #e7dfd1;
  --ink:        #1f1c18;
  --ink-soft:   #5a534a;
  --bronze:     #9a7b4f;
  --bronze-dk:  #7a5f3a;
  --porphyry:   #5b1f24;
  --line:       rgba(31, 28, 24, 0.14);

  --display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --serif:   'Cormorant Garamond', Garamond, Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column;
  background: var(--travertine);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(rgba(154,123,79,0.05) 1px, transparent 1px),
    radial-gradient(rgba(31,28,24,0.025) 1px, transparent 1px);
  background-size: 7px 7px, 13px 13px;
  background-position: 0 0, 3px 5px;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- Monogram ---------- */
.monogram {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--bronze);
  border-radius: 50%;
  font-family: var(--display); font-size: 13px; letter-spacing: 0.08em;
  color: var(--bronze-dk);
  position: relative;
}
.monogram::after {
  content: ""; position: absolute; inset: 3px;
  border: 1px solid rgba(154,123,79,0.35); border-radius: 50%;
}

/* ---------- Nav ---------- */
/* Side padding grows on wide screens and respects iPhone notches */
:root { --gutter: clamp(20px, 3.4vw, 64px); }
.nav {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: max(clamp(16px, 2.2vw, 32px), env(safe-area-inset-top))
           max(var(--gutter), env(safe-area-inset-right))
           0
           max(var(--gutter), env(safe-area-inset-left));
}
.nav__mark { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.nav__name {
  font-family: var(--display); font-size: clamp(12px, 0.95vw, 17px);
  letter-spacing: 0.28em; text-transform: uppercase;
}
.nav__login {
  font-family: var(--display); font-size: clamp(11px, 0.8vw, 14px);
  letter-spacing: 0.25em; text-transform: uppercase; white-space: nowrap;
  color: var(--bronze-dk);
  min-height: 44px; padding: 0 clamp(16px, 1.6vw, 28px); border: 1px solid var(--bronze);
  transition: background .3s, color .3s;
}
@media (hover: hover) { .nav__login:hover { background: var(--bronze); color: var(--marble); } }
.nav__login:active { background: var(--bronze); color: var(--marble); }
.nav__login:focus-visible, .btn:focus-visible, .portal__close:focus-visible {
  outline: 2px solid var(--bronze); outline-offset: 3px;
}

/* ---------- Hero ---------- */
/* Everything scales with the smaller of screen width and height,
   so the composition fits a phone, a laptop, or a 4K monitor in one view. */
.hero {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: clamp(84px, 12vh, 160px) var(--gutter) clamp(32px, 6vh, 80px);
}
.temple {
  width: min(88vw, 56vh, 820px);
  width: min(88vw, 56svh, 820px);
  height: auto; margin-bottom: clamp(24px, 4.5vh, 64px);
}
.temple__lines * { fill: none; stroke: var(--bronze); stroke-width: 1.2; }
.temple__lines .thin, .temple__lines .flute { stroke-width: 0.6; opacity: .7; }
.temple__lines text.temple__inscription {
  fill: var(--bronze-dk); stroke: none;
  font-family: var(--display); font-size: 12px; letter-spacing: 6px;
  text-anchor: middle;
}
.temple__lines path, .temple__lines rect, .temple__lines circle {
  stroke-dasharray: 1200; stroke-dashoffset: 1200;
  animation: draw 2.6s cubic-bezier(.6,.1,.2,1) forwards;
}
.temple__lines use { opacity: 0; animation: rise 1.4s ease forwards; }
.temple__lines use:nth-of-type(1) { animation-delay: .5s; }
.temple__lines use:nth-of-type(2) { animation-delay: .62s; }
.temple__lines use:nth-of-type(3) { animation-delay: .74s; }
.temple__lines use:nth-of-type(4) { animation-delay: .86s; }
.temple__lines use:nth-of-type(5) { animation-delay: .98s; }
.temple__lines use:nth-of-type(6) { animation-delay: 1.1s; }
.temple__inscription { opacity: 0; animation: fade 1.6s ease 1.6s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }

.hero__title {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(26px, min(5.2vw, 7.5vh), 104px);
  letter-spacing: 0.18em; text-transform: uppercase; line-height: 1.1;
  text-indent: 0.18em; /* balances trailing letter-spacing so it centers truly */
  opacity: 0; animation: rise 1.4s ease 1.2s forwards;
}
.hero__title span { color: var(--bronze); }
.hero__motto {
  margin-top: clamp(10px, 2vh, 24px);
  font-style: italic; font-size: clamp(19px, min(2.2vw, 3vh), 34px);
  color: var(--porphyry); letter-spacing: 0.04em;
  opacity: 0; animation: fade 1.4s ease 1.7s forwards;
}
.hero__est {
  margin-top: clamp(20px, 4vh, 48px);
  font-family: var(--display); font-size: clamp(11px, 0.85vw, 15px);
  letter-spacing: 0.4em; color: var(--bronze-dk);
  display: flex; align-items: center; gap: 18px;
  opacity: 0; animation: fade 1.4s ease 2.1s forwards;
}
.hero__est::before, .hero__est::after {
  content: ""; width: 48px; height: 1px; background: var(--bronze); opacity: .6;
}

/* ---------- Footer ---------- */
.footer {
  padding: clamp(20px, 3vh, 32px) var(--gutter) max(clamp(20px, 3vh, 32px), env(safe-area-inset-bottom));
  text-align: center;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}
.footer__legal {
  max-width: 46em; margin: 0 auto;
  font-size: clamp(13px, 0.85vw, 16px); line-height: 1.6;
}
.footer__copy {
  margin-top: 10px; font-family: var(--display); font-size: clamp(10px, 0.7vw, 13px); letter-spacing: 0.25em;
  color: var(--bronze-dk);
}

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-block; width: 100%; margin-top: 28px;
  font-family: var(--display); font-size: 13px; letter-spacing: 0.25em; text-transform: uppercase;
  padding: 15px 24px; background: var(--ink); color: var(--travertine);
  transition: background .3s;
}
@media (hover: hover) { .btn:hover { background: var(--bronze-dk); } }
.btn:disabled { opacity: .6; cursor: wait; }

.field { display: block; margin-top: 22px; text-align: left; }
.field span {
  display: block; margin-bottom: 6px;
  font-family: var(--display); font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--ink-soft);
}
.field input {
  width: 100%; padding: 10px 2px;
  font: inherit; font-size: 19px; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid rgba(31,28,24,0.3);
  outline: none; transition: border-color .3s;
}
.field input:focus { border-bottom-color: var(--bronze); }

/* ---------- Investor portal modal ---------- */
.portal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; /* panel uses margin:auto so tall content stays scrollable */
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; transition: opacity .3s ease;
}
.portal.is-open { opacity: 1; }
.portal__backdrop {
  position: fixed; inset: 0;
  background: rgba(31, 28, 24, 0.55); backdrop-filter: blur(4px);
}
.portal__panel {
  position: relative; width: min(420px, 100%); margin: auto;
  padding: 52px 44px 44px; text-align: center;
  background: var(--marble);
  border: 1px solid var(--bronze);
  outline: 1px solid rgba(154,123,79,0.35); outline-offset: -8px;
  transform: translateY(12px); transition: transform .3s ease;
}
.portal.is-open .portal__panel { transform: none; }
.portal__close {
  position: absolute; top: 6px; right: 6px;
  width: 44px; height: 44px;
  font-size: 28px; line-height: 1; color: var(--ink-soft);
}
.portal__close:hover { color: var(--ink); }
.portal__panel h2 {
  margin-top: 22px;
  font-family: var(--display); font-weight: 500; font-size: 20px;
  letter-spacing: 0.22em; text-transform: uppercase;
}
.portal__text { margin-top: 16px; color: var(--ink-soft); font-size: 19px; }
.portal__text em { color: var(--porphyry); }
.portal__error {
  margin-top: 20px; padding: 12px;
  font-size: 16px; line-height: 1.5; color: var(--porphyry);
  border: 1px solid rgba(91,31,36,0.3); background: rgba(91,31,36,0.04);
}

/* ---------- Responsive ---------- */
/* Phones (portrait): stack the name on two lines so it can be large */
@media (max-width: 600px) {
  body { font-size: 18px; }
  .hero__title { font-size: clamp(26px, 9.5vw, 46px); }
  .hero__title span { display: block; }
  .portal__panel { padding: 48px 24px 32px; }
}

/* Narrow phones (iPhone SE, mini, small Androids): shorten the button */
@media (max-width: 400px) {
  .nav__login .xs-hide { display: none; }
}
@media (max-width: 340px) {
  .nav__name { font-size: 11px; letter-spacing: 0.16em; }
  .nav__login { font-size: 10px; letter-spacing: 0.16em; padding: 0 12px; }
}

/* Short screens (phones in landscape) */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { padding-top: 72px; padding-bottom: 24px; }
  .temple { width: min(60vw, 46vh, 46svh); }
  .hero__est { display: none; }
  .portal__panel { width: min(520px, 100%); padding: 28px 36px 24px; }
  .portal__panel .monogram { display: none; }
  .portal__panel h2 { margin-top: 0; }
  .field { margin-top: 12px; }
  .btn { margin-top: 18px; padding: 12px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .temple__lines path, .temple__lines rect, .temple__lines circle { stroke-dashoffset: 0; }
  .temple__lines use, .temple__inscription, .hero__title, .hero__motto, .hero__est { opacity: 1; transform: none; }
}
