/* ==========================================================================
   Ryan Bray — Personal Site
   Design system: architectural blueprint / drafting sheet
   ========================================================================== */

:root {
  --ink: #0f2a44;
  --ink-deep: #0a1e33;
  --line: #cbe9ef;
  --line-dim: rgba(203, 233, 239, 0.32);
  --line-faint: rgba(203, 233, 239, 0.14);
  --paper: #f3eee1;
  --paper-dim: #e7e0cd;
  --graphite: #201f1a;
  --brass: #cd9a4f;
  --brass-deep: #8c5f26;

  --display: "Space Grotesk", "Arial Narrow", sans-serif;
  --body: "IBM Plex Sans", -apple-system, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", monospace;

  --sheet-margin: clamp(1.25rem, 4vw, 4.5rem);
  --rail: 64px;
}

html {
  font-size: clamp(16px, 0.5vw + 14px, 19px);
}

@media (max-width: 720px) {
  :root {
    --rail: 0px;
  }
}

/* ---------- reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@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;
  }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--line);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-family: var(--display); color: var(--paper); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--brass); color: var(--ink-deep); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

/* ---------- blueprint grid backdrop ---------- */
.grid-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, var(--line-faint) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(90deg, var(--line-faint) 0 1px, transparent 1px 88px);
  opacity: 0;
  animation: grid-in 1.4s ease-out 0.15s forwards;
}
@keyframes grid-in {
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .grid-field { opacity: 1; animation: none; }
}

/* ---------- edge rail (ruler + nav) ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 20;
  border-right: 1px solid var(--line-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
}
@media (max-width: 720px) { .rail { display: none; } }

.rail-mark {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--line-dim);
  writing-mode: vertical-rl;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
.rail-nav a {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--line-dim);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}
.rail-nav a:hover,
.rail-nav a:focus-visible,
.rail-nav a.is-current { color: var(--brass); }
.rail-nav a::before {
  content: "";
  position: absolute;
  left: -0.9rem;
  top: 50%;
  width: 0.5rem;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.rail-compass {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-dim);
  border-radius: 50%;
  position: relative;
}
.rail-compass::before,
.rail-compass::after {
  content: "";
  position: absolute;
  background: var(--line-dim);
}
.rail-compass::before { left: 50%; top: 3px; bottom: 3px; width: 1px; transform: translateX(-50%); }
.rail-compass::after { top: 50%; left: 3px; right: 3px; height: 1px; transform: translateY(-50%); }

/* ---------- top bar (mobile) ---------- */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--ink);
  border-bottom: 1px solid var(--line-dim);
  padding: 0.9rem var(--sheet-margin);
  align-items: center;
  justify-content: space-between;
}
@media (max-width: 720px) { .topbar { display: flex; } }
.topbar .mark { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.14em; }
.topbar nav { display: flex; gap: 1.1rem; }
.topbar nav a {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--line-dim);
}
.topbar nav a:hover, .topbar nav a:focus-visible, .topbar nav a.is-current { color: var(--brass); }

/* ---------- sheet layout ---------- */
main { position: relative; z-index: 1; margin-left: var(--rail); }

.sheet {
  position: relative;
  padding: clamp(4rem, 12vh, 7rem) var(--sheet-margin) clamp(3rem, 8vh, 5rem);
  border-bottom: 1px solid var(--line-dim);
  max-width: 1440px;
  margin-inline: auto;
}

.sheet-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--line-dim);
}
.sheet-head .num { color: var(--brass); }
.sheet-head .rule { flex: 1; height: 1px; background: var(--line-dim); }

.corner-ticks {
  position: absolute;
  inset: 1.1rem;
  pointer-events: none;
}
.corner-ticks::before,
.corner-ticks::after,
.corner-ticks span::before,
.corner-ticks span::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--line-dim);
  border-style: solid;
}
.corner-ticks::before { top: 0; left: 0; border-width: 1px 0 0 1px; }
.corner-ticks::after { top: 0; right: 0; border-width: 1px 1px 0 0; }
.corner-ticks span::before { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.corner-ticks span::after { bottom: 0; right: 0; border-width: 0 1px 1px 0; }
@media (max-width: 720px) { .corner-ticks { display: none; } }

/* ---------- hero ---------- */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid var(--line-dim); }

.hero-mark {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.25rem;
}
.hero-mark svg { width: 56px; height: 56px; }
.hero-mark .circle {
  fill: none;
  stroke: var(--brass);
  stroke-width: 1;
  stroke-dasharray: 176;
  stroke-dashoffset: 176;
  animation: draw 1.1s ease-out 0.3s forwards;
}
.hero-mark .cross {
  stroke: var(--line-dim);
  stroke-width: 1;
}
@media (prefers-reduced-motion: reduce) {
  .hero-mark .circle { animation: none; stroke-dashoffset: 0; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.hero-mark .lockup {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--line-dim);
  line-height: 1.5;
}
.hero-mark .lockup strong { display: block; color: var(--line); font-size: 0.78rem; }

.hero h1 {
  font-size: clamp(3rem, 6vw, 7rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  max-width: 16ch;
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.8s ease-out 0.5s forwards;
}
.hero .role {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--brass);
  margin-top: 1.4rem;
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.8s ease-out 0.65s forwards;
}
.hero p.lede {
  margin-top: 1.6rem;
  max-width: 46ch;
  font-size: 1.08rem;
  color: var(--line);
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.8s ease-out 0.8s forwards;
}
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .hero h1, .hero .role, .hero p.lede { opacity: 1; transform: none; animation: none; }
}

.hero-coords {
  margin-top: 3.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--line-dim);
}
.hero-coords .val { color: var(--line); display: block; font-size: 0.82rem; margin-top: 0.15rem; }

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
}
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 2.5rem; } }

.about-grid h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.15;
  margin-bottom: 1.4rem;
}
.about-grid p { color: var(--line); font-size: 1.02rem; margin-bottom: 1.1rem; max-width: 56ch; }
.about-grid p:last-child { margin-bottom: 0; }

.spec-table {
  align-self: start;
  border-top: 1px solid var(--line-dim);
}
.spec-table div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line-dim);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.spec-table dt { color: var(--line-dim); letter-spacing: 0.06em; text-transform: uppercase; }
.spec-table dd { margin: 0; color: var(--line); text-align: right; }

/* ---------- expertise plates ---------- */
.plate-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-dim);
  border: 1px solid var(--line-dim);
}
@media (max-width: 720px) { .plate-grid { grid-template-columns: 1fr; } }

.plate {
  background: var(--ink);
  padding: 2.4rem 2.2rem;
  position: relative;
  transition: background 0.25s ease;
}
.plate:hover, .plate:focus-within { background: var(--ink-deep); }

.plate .plate-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--brass);
  display: block;
  margin-bottom: 1.4rem;
}
.plate .glyph { width: 34px; height: 34px; margin-bottom: 1.6rem; color: var(--line-dim); }
.plate:hover .glyph, .plate:focus-within .glyph { color: var(--brass); transition: color 0.25s ease; }
.plate h3 { font-size: 1.18rem; margin-bottom: 0.75rem; line-height: 1.3; }
.plate p { color: var(--line-dim); font-size: 0.94rem; max-width: 42ch; }

/* ---------- contact / title block ---------- */
.title-block {
  border: 1px solid var(--line-dim);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
}
@media (max-width: 780px) { .title-block { grid-template-columns: 1fr; } }

.title-block .lead {
  padding: 3rem;
  border-right: 1px solid var(--line-dim);
}
@media (max-width: 780px) { .title-block .lead { border-right: none; border-bottom: 1px solid var(--line-dim); } }

.title-block .lead h2 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  margin-bottom: 1.2rem;
  line-height: 1.1;
}
.title-block .lead p { color: var(--line); max-width: 46ch; font-size: 1.02rem; }

.title-block .fields { padding: 3rem; display: flex; flex-direction: column; gap: 1.5rem; }
.title-block .field dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--line-dim);
  margin-bottom: 0.35rem;
}
.title-block .field dd {
  margin: 0;
  font-size: 1.02rem;
}
.title-block .field a {
  border-bottom: 1px solid var(--brass-deep);
  padding-bottom: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.title-block .field a:hover, .title-block .field a:focus-visible {
  color: var(--brass);
  border-color: var(--brass);
}

.social-legend { display: flex; gap: 1.1rem; padding-top: 0.5rem; }
.social-legend a {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.social-legend svg { width: 16px; height: 16px; }
.social-legend a:hover, .social-legend a:focus-visible {
  border-color: var(--brass);
  color: var(--brass);
  transform: translateY(-2px);
}

/* ---------- footer ---------- */
footer.stamp {
  padding: 1.6rem var(--sheet-margin);
  margin-left: var(--rail);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--line-dim);
  position: relative;
  z-index: 1;
}
