/* ════════════════════════════════════════════════════════════
   SINADSML — DOCUMENT SET · core.css
   The site as an architectural drawing set.
   Cold blueprint blue (Madrid, technique) + warm sand (Yazd, origin)
   ════════════════════════════════════════════════════════════ */

:root {
  --ink:         #05080f;            /* page background — night blueprint   */
  --ink-2:       #0a0f1a;            /* raised panel                        */
  --ink-3:       #0f1626;            /* hover panel                         */
  --blue:        #2e6bc9;            /* blueprint line                      */
  --blue-hi:     #5b93ec;            /* bright interaction                  */
  --blue-glow:   rgba(46,107,201,0.14);
  --blue-dim:    rgba(46,107,201,0.26);
  --sand:        #c9a36a;            /* Yazd — brass / adobe, used sparingly*/
  --sand-dim:    rgba(201,163,106,0.35);
  --text:        #e7edf6;
  --text-dim:    #8294ab;
  --text-faint:  #36465c;
  --line:        rgba(141,170,210,0.085);
  --line-mid:    rgba(141,170,210,0.16);
  --mono:        'DM Mono', monospace;
  --serif:       'Cormorant Garamond', serif;
  --sans:        'Syne', sans-serif;
  --frame:       16px;               /* drawing-frame inset                 */
  --gm:          clamp(2rem, 7vw, 6rem);
  --mw:          1160px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(46,107,201,0.30); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 1px solid var(--blue-hi);
  outline-offset: 3px;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--text-faint); }

/* ── blueprint micro-grid ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(46,107,201,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46,107,201,0.022) 1px, transparent 1px);
  background-size: 72px 72px;
  pointer-events: none; z-index: 0;
}

/* ════════ DRAWING FRAME — fixed plot border ════════ */
.sheet-frame {
  position: fixed; inset: var(--frame);
  border: 1px solid var(--line-mid);
  pointer-events: none; z-index: 200;
}
.sheet-frame::before, .sheet-frame::after,
.sheet-frame .tick-b::before, .sheet-frame .tick-b::after {
  content: ''; position: absolute;
  width: 14px; height: 14px;
  border-color: var(--blue); border-style: solid;
}
.sheet-frame::before          { top: -1px;  left: -1px;  border-width: 1px 0 0 1px; }
.sheet-frame::after           { top: -1px;  right: -1px; border-width: 1px 1px 0 0; }
.sheet-frame .tick-b::before  { bottom: -1px; left: -1px;  border-width: 0 0 1px 1px; }
.sheet-frame .tick-b::after   { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

/* registration cross — mid edges */
.sheet-frame .reg {
  position: absolute; width: 9px; height: 9px;
  background:
    linear-gradient(var(--line-mid), var(--line-mid)) center/1px 9px no-repeat,
    linear-gradient(var(--line-mid), var(--line-mid)) center/9px 1px no-repeat;
}
.sheet-frame .reg.t { top: -5px; left: 50%; transform: translateX(-50%); }
.sheet-frame .reg.b { bottom: -5px; left: 50%; transform: translateX(-50%); }
.sheet-frame .reg.l { left: -5px; top: 50%; transform: translateY(-50%); }
.sheet-frame .reg.r { right: -5px; top: 50%; transform: translateY(-50%); }

/* ════════ TITLE BLOCK — fixed bottom bar ════════ */
.title-block {
  position: fixed;
  left: var(--frame); right: var(--frame); bottom: var(--frame);
  height: 36px; z-index: 210;
  display: flex; align-items: stretch;
  background: rgba(5,8,15,0.92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-mid);
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint);
}
.title-block .tb-cell {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}
.title-block .tb-cell b { font-weight: 400; color: var(--text-dim); }
.title-block .tb-sheet { color: var(--ink); background: var(--blue); font-weight: 500; letter-spacing: 0.2em; }
.title-block .tb-sheet b { color: var(--ink); }
.title-block .tb-grow { flex: 1; border-right: none; justify-content: flex-end; }
.title-block .tb-coords { color: var(--sand); letter-spacing: 0.12em; min-width: 150px; justify-content: flex-end; }
.tb-stamp { color: var(--sand); border: 1px solid var(--sand-dim); padding: 2px 8px; letter-spacing: 0.2em; }

/* ════════ CAD CURSOR ════════ */
#cad-x, #cad-y { position: fixed; z-index: 190; pointer-events: none; opacity: 0; transition: opacity 0.4s; }
#cad-x { left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(46,107,201,0.20) 18%, rgba(46,107,201,0.20) 82%, transparent); }
#cad-y { top: 0; bottom: 0; width: 1px; background: linear-gradient(180deg, transparent, rgba(46,107,201,0.20) 18%, rgba(46,107,201,0.20) 82%, transparent); }
body.cad-on #cad-x, body.cad-on #cad-y { opacity: 1; }

/* ════════ NAV ════════ */
nav.bar {
  position: fixed; top: var(--frame); left: var(--frame); right: var(--frame);
  z-index: 180; height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1.2rem, 4vw, 3rem);
  background: rgba(5,8,15,0.85);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-logo { width: 28px; height: 28px; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.nav-logo svg { width: 100%; height: 100%; }
.nav-name { font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.nav-name span { color: var(--text-faint); font-weight: 400; margin-left: 8px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; }

.nav-links { display: flex; align-items: center; gap: 2.4rem; list-style: none; }
.nav-links a { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--text-dim); text-transform: uppercase; transition: color 0.2s; position: relative; }
.nav-links a::after { content: ''; position: absolute; left: 0; bottom: -6px; width: 100%; height: 1px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform 0.3s cubic-bezier(0.16,1,0.3,1); }
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-back {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-dim);
  border: 1px solid var(--line-mid); padding: 9px 18px;
  transition: all 0.25s;
}
.nav-back:hover { color: var(--text); border-color: var(--blue-dim); background: var(--blue-glow); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 6px; }
.nav-toggle span { display: block; width: 20px; height: 1px; background: var(--text-dim); transition: 0.3s; }

/* ════════ SECTION HEAD — dimension line ════════ */
.dim-head {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 1rem;
}
.dim-head .dim-line { flex: 1; height: 1px; background: var(--line-mid); position: relative; }
.dim-head .dim-line::before, .dim-head .dim-line::after {
  content: ''; position: absolute; top: -4px; width: 1px; height: 9px; background: var(--line-mid);
}
.dim-head .dim-line::before { left: 0; } .dim-head .dim-line::after { right: 0; }
.dim-head .dim-label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--blue);
}
.dim-head .dim-no { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.2em; color: var(--text-faint); }

.sec-title { font-family: var(--serif); font-size: clamp(2.3rem, 4.5vw, 3.8rem); font-weight: 300; letter-spacing: -0.01em; line-height: 1.02; }
.sec-title em { font-style: italic; color: var(--text-dim); }

/* ════════ BUTTONS ════════ */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; padding: 14px 26px;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
  position: relative;
}
.btn-primary { background: var(--blue); color: #04070d; font-weight: 500; }
.btn-primary:hover { background: var(--blue-hi); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--line-mid); color: var(--text-dim); }
.btn-ghost:hover { border-color: var(--blue-dim); color: var(--text); background: var(--blue-glow); }

/* ════════ TAGS ════════ */
.tag {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--blue-hi);
  border: 1px solid var(--blue-dim); padding: 3px 9px;
}
.tag.warm { color: var(--sand); border-color: var(--sand-dim); }

/* ════════ REVEAL ════════ */
.rv { opacity: 0; transform: translateY(26px); transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1), transform 0.9s cubic-bezier(0.16,1,0.3,1); }
.rv.in { opacity: 1; transform: none; }
.rv.d1 { transition-delay: 0.12s; } .rv.d2 { transition-delay: 0.24s; } .rv.d3 { transition-delay: 0.36s; }

@keyframes fu { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }
.pulse { width: 5px; height: 5px; border-radius: 50%; background: var(--blue-hi); animation: pulse 3s ease-in-out infinite; }

/* hero canvas */
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ════════ FOOTER ════════ */
footer.site {
  border-top: 1px solid var(--line);
  padding: 2.4rem var(--gm) calc(2.4rem + 36px);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  position: relative; z-index: 1;
}
footer.site .f-brand { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
footer.site .f-links { display: flex; gap: 2rem; }
footer.site a { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); transition: color 0.2s; }
footer.site a:hover { color: var(--blue-hi); }
footer.site .f-c { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }

/* ════════ MOBILE ════════ */
@media (max-width: 760px) {
  :root { --frame: 9px; }
  .sheet-frame .reg { display: none; }
  .nav-links {
    position: fixed; inset: calc(var(--frame) + 58px) var(--frame) var(--frame);
    background: rgba(5,8,15,0.97); flex-direction: column; justify-content: center; gap: 2.2rem;
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: 0.35s;
    z-index: 170;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { font-size: 13px; }
  .nav-toggle { display: flex; }
  .title-block .tb-hide-m { display: none; }
  .title-block { font-size: 8px; height: 32px; }
  .title-block .tb-cell { padding: 0 10px; }
  .title-block .tb-coords { min-width: 0; }
}

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