:root{
  --ink:        #0B2233;
  --ink-2:      #102A3D;
  --panel:      #0E2E44;
  --line:       #4FA8D8;
  --line-soft:  rgba(143,205,236,0.55);
  --line-dim:   rgba(143,205,236,0.14);
  --grid:       rgba(143,205,236,0.07);
  --paper:      #E9F3F9;
  --muted:      #7CA0B6;
  --muted-2:    #547289;
  --amber:      #FFB454;
  --amber-dim:  rgba(255,180,84,0.16);
  --green:      #8FD6A8;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --sheet-inset: 18px;
}

@media (min-width: 720px){
  :root{ --sheet-inset: 30px; }
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body{
  margin:0;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0/38px 38px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0/38px 38px,
    var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; }

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

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

/* ---------- Drawing-sheet frame ---------- */

.sheet{
  position: relative;
  margin: var(--sheet-inset);
  border: 1.5px solid var(--line-soft);
  min-height: calc(100vh - (var(--sheet-inset) * 2));
}

.crosshair{
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.crosshair::before, .crosshair::after{
  content: "";
  position: absolute;
  background: var(--line);
}
.crosshair::before{ width: 100%; height: 1.5px; top: 50%; left: 0; transform: translateY(-50%); }
.crosshair::after{ height: 100%; width: 1.5px; left: 50%; top: 0; transform: translateX(-50%); }
.crosshair.tl{ top: -11px; left: -11px; }
.crosshair.tr{ top: -11px; right: -11px; }
.crosshair.bl{ bottom: -11px; left: -11px; }
.crosshair.br{ bottom: -11px; right: -11px; }

.frame-label{
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted-2);
  text-transform: uppercase;
}
.frame-label.top-l{ top: -9px; left: 24px; background: var(--ink); padding: 0 8px; }
.frame-label.top-r{ top: -9px; right: 24px; background: var(--ink); padding: 0 8px; }
.frame-label.bot-l{ bottom: -9px; left: 24px; background: var(--ink); padding: 0 8px; }
.frame-label.bot-r{ bottom: -9px; right: 24px; background: var(--ink); padding: 0 8px; }

/* ---------- Header ---------- */

header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--line-dim);
}

.wordmark{
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}
.wordmark .dot{
  width: 7px; height: 7px;
  background: var(--amber);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse{
  0%, 100%{ opacity: 1; box-shadow: 0 0 0 0 var(--amber-dim); }
  50%{ opacity: 0.55; box-shadow: 0 0 0 6px transparent; }
}

nav{
  display: flex;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
nav a{ text-decoration: none; color: var(--muted); transition: color 0.15s ease; }
nav a:hover{ color: var(--paper); }

@media (max-width: 640px){
  header{ padding: 22px 18px 16px; }
  nav{ gap: 16px; font-size: 10.5px; }
}

/* ---------- Hero / title block ---------- */

.hero{
  padding: 64px 32px 56px;
  border-bottom: 1px solid var(--line-dim);
  position: relative;
}

.hero-eyebrow{
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 18px;
}

h1{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5.2vw, 4.1rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  max-width: 15ch;
}

.hero-sub{
  font-size: 16.5px;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 40px;
}
.hero-sub strong{ color: var(--paper); font-weight: 500; }

.titleblock{
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 0;
  border: 1px solid var(--line-dim);
  width: fit-content;
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.titleblock div{
  padding: 10px 18px;
  border-right: 1px solid var(--line-dim);
}
.titleblock div:last-child{ border-right: none; }
.titleblock .tb-label{
  display: block;
  color: var(--muted-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 9.5px;
  margin-bottom: 4px;
}
.titleblock .tb-value{ color: var(--paper); }

@media (max-width: 640px){
  .hero{ padding: 44px 18px 40px; }
  .titleblock{ grid-template-columns: repeat(2, auto); }
}

/* ---------- Project index ---------- */

.index-heading{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 32px 32px 0;
}
.index-heading h2{
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
  font-weight: 500;
}
.index-count{
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-2);
}

.projects{
  padding: 20px 0 10px;
}

.project{
  display: grid;
  grid-template-columns: 88px 1.6fr 1fr 100px;
  gap: 24px;
  align-items: start;
  padding: 26px 32px;
  border-top: 1px dashed var(--line-dim);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.project.in-view{ opacity: 1; transform: translateY(0); }
.project:last-child{ border-bottom: 1px dashed var(--line-dim); }

.proj-code{
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-2);
  padding-top: 4px;
}
.proj-code span{
  display: block;
  font-size: 26px;
  color: var(--line);
  font-weight: 500;
  margin-top: 2px;
}

.proj-name{
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.005em;
}
.proj-name a{ text-decoration: none; }
.proj-name a:hover{ color: var(--amber); }
.proj-desc{
  color: var(--muted);
  font-size: 14.5px;
  margin: 0;
  max-width: 46ch;
}

.proj-stack{
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-content: flex-start;
  padding-top: 3px;
}
.tag{
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
  border: 1px solid var(--line-dim);
  padding: 4px 8px;
  white-space: nowrap;
}

.proj-status{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
}
.status{
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  padding: 4px 9px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.status::before{
  content:"";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status--live{ color: var(--green); border-color: rgba(143,214,168,0.3); }
.status--live::before{ animation: pulse 2.4s ease-in-out infinite; }
.status--build{ color: var(--amber); border-color: rgba(255,180,84,0.3); }
.status--spec{ color: var(--muted); border-color: var(--line-dim); }
.status--handoff{ color: #9FC6E0; border-color: rgba(159,198,224,0.3); }

.proj-link{
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: none;
  color: var(--muted-2);
  transition: color 0.15s ease;
}
.proj-link:hover{ color: var(--paper); }

@media (max-width: 860px){
  .project{
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 24px 18px;
  }
  .proj-code{ display: flex; align-items: baseline; gap: 10px; padding-top: 0; }
  .proj-code span{ font-size: 18px; margin: 0; }
  .proj-status{ flex-direction: row; align-items: center; justify-content: space-between; }
}

.index-heading{
  padding-left: 32px;
}
@media (max-width: 640px){
  .index-heading{ padding: 28px 18px 0; }
}

/* open slot card */
.project.open-slot .proj-name{ color: var(--muted); }
.project.open-slot .proj-desc{ font-style: italic; }

/* ---------- Build log / notes sections ---------- */

.log-section{
  padding: 44px 32px 20px;
  border-top: 1px solid var(--line-dim);
}
.log-section h2{
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
  font-weight: 500;
}

table.log{
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
table.log th{
  text-align: left;
  color: var(--muted-2);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10px;
  padding: 0 16px 10px 0;
  border-bottom: 1px solid var(--line-dim);
}
table.log td{
  padding: 12px 16px 12px 0;
  border-bottom: 1px dashed var(--line-dim);
  color: var(--muted);
  vertical-align: top;
}
table.log td.rev{ color: var(--amber); width: 60px; }
table.log td.note{ color: var(--paper); }
table.log td.date{ width: 150px; white-space: nowrap; }

@media (max-width: 640px){
  .log-section{ padding: 36px 18px 16px; }
  table.log{ font-size: 11px; }
  table.log th:nth-child(3), table.log td:nth-child(3){ display: none; }
}

/* ---------- Detail page: notes / prose ---------- */

.detail-prose{
  color: var(--muted);
  font-size: 14.5px;
  max-width: 62ch;
}
.detail-prose p{ margin: 0 0 14px; }
.detail-prose p:last-child{ margin-bottom: 0; }
.detail-prose strong{ color: var(--paper); font-weight: 500; }

.detail-stack{
  padding: 0 32px 8px;
}
@media (max-width: 640px){
  .detail-stack{ padding: 0 18px 4px; }
}

/* ---------- Footer ---------- */

footer{
  padding: 30px 32px 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
}
footer .foot-links{ display: flex; gap: 20px; }
footer a{ text-decoration: none; color: var(--muted-2); }
footer a:hover{ color: var(--paper); }

@media (max-width: 640px){
  footer{ padding: 26px 18px 32px; }
}
