/* ==========================================================================
   Dennis Fichman — Architecture Design Services
   Design system: drafting sheet — hairline frame, corner registration marks,
   sheet-number labels, serif display + mono annotation face.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --paper: #FAFAF7;
  --paper-dim: #F2F1EA;
  --ink: #1A1A18;
  --graphite: #6B6B65;
  --line: #D8D6CE;
  --line-strong: #B8B6AC;
  --redline: #B23A2F;
  --redline-dim: #B23A2F1a;

  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'IBM Plex Mono', 'SF Mono', monospace;

  --frame-gap: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

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

a { color: inherit; text-decoration: none; }

/* ---------- Drafting sheet frame ---------- */

.sheet {
  position: relative;
  background: var(--paper);
  min-height: 100vh;
  margin: var(--frame-gap);
  border: 1px solid var(--ink);
}

.sheet::before,
.sheet::after,
.sheet .tick-tr,
.sheet .tick-bl {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  z-index: 40;
  pointer-events: none;
}
.sheet::before { border-top: 2px solid var(--redline); border-left: 2px solid var(--redline); }
.sheet::after { border-bottom: 2px solid var(--redline); border-right: 2px solid var(--redline); }
.tick-tr { border-top: 2px solid var(--redline); border-right: 2px solid var(--redline); }
.tick-bl { border-bottom: 2px solid var(--redline); border-left: 2px solid var(--redline); }

.sheet-label {
  position: absolute;
  bottom: calc(var(--frame-gap) + 10px);
  right: calc(var(--frame-gap) + 34px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--graphite);
  z-index: 40;
  text-align: right;
  pointer-events: none;
}
.sheet-label span { display: block; }
.sheet-label .num { color: var(--redline); font-weight: 500; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.brand small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--graphite);
  text-transform: uppercase;
  margin-top: 2px;
}

.main-nav {
  display: flex;
  gap: 34px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.main-nav a {
  position: relative;
  padding-bottom: 3px;
  color: var(--graphite);
  transition: color 0.2s ease;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--ink); }
.main-nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px;
  background: var(--redline);
}

.nav-toggle { display: none; }

/* ---------- Layout helpers ---------- */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 40px;
}

section { padding: 110px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }
.tight { padding: 70px 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--redline);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.eyebrow::before {
  content: '';
  width: 26px;
  height: 1px;
  background: var(--redline);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; }
h1 { font-size: clamp(42px, 6vw, 78px); font-weight: 400; letter-spacing: -0.01em; }
h2 { font-size: clamp(30px, 3.6vw, 44px); }
h3 { font-size: 21px; }

p.lede {
  font-size: 19px;
  color: var(--graphite);
  max-width: 620px;
  line-height: 1.6;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid-3 > * { background: var(--paper); padding: 40px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 15px 26px;
  border: 1px solid var(--ink);
  transition: background 0.2s ease, color 0.2s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-accent {
  border-color: var(--redline);
  background: var(--redline);
  color: var(--paper);
}
.btn-accent:hover { background: var(--ink); border-color: var(--ink); }
.btn-arrow { transition: transform 0.2s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding-top: 90px;
  padding-bottom: 90px;
  padding-left: 40px;
  padding-right: 40px;
}
.hero-drawing { position: relative; }
.hero-drawing svg { width: 100%; height: auto; }
.draw-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  animation: draw 0.35s ease-in-out forwards;
  animation-delay: calc(0.3s + var(--i, 0) * 0.32s);
}
.draw-line.accent { stroke: var(--redline); }
@keyframes draw { from { opacity: 1; stroke-dashoffset: 1; } to { opacity: 1; stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .draw-line { animation: none; opacity: 1; stroke-dashoffset: 0; }
}

.hero-meta {
  display: flex;
  gap: 34px;
  margin-top: 40px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--graphite);
}
.hero-meta div span { display: block; color: var(--ink); font-size: 14px; margin-top: 4px; }

/* ---------- Pipeline / process ---------- */

.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.pipeline > div {
  padding: 34px 26px;
  border-right: 1px solid var(--line);
  position: relative;
}
.pipeline > div:last-child { border-right: none; }
.pipeline .step-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--redline);
  margin-bottom: 18px;
}
.pipeline h3 { font-size: 18px; margin-bottom: 10px; }
.pipeline p { color: var(--graphite); font-size: 14.5px; }
.pipeline-connector {
  display: flex;
  justify-content: space-between;
  padding: 0 26px;
  margin-top: -1px;
}
.pipeline-connector span { font-family: var(--mono); font-size: 10px; color: var(--line-strong); }

/* ---------- Cards ---------- */

.card {
  border: 1px solid var(--line);
  padding: 36px;
  transition: border-color 0.2s ease;
}
.card:hover { border-color: var(--ink); }
.card .eyebrow { margin-bottom: 14px; }

/* ---------- Portfolio ---------- */

.portfolio-controls { margin-bottom: 28px; }
.portfolio-controls[hidden], .chip[hidden] { display: none; }
.gallery { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.tile[hidden] { display: none; }
.tile a { display: block; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); transition: border-color 0.2s ease; }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.35s ease; }
.tile a:focus-visible { border-color: var(--redline); }
@media (hover: hover) {
  .tile a:hover { border-color: var(--ink); }
  .tile a:hover img { transform: scale(1.025); }
}

.note-box {
  border: 1px dashed var(--line-strong);
  padding: 24px 28px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--graphite);
  line-height: 1.7;
}
.note-box strong { color: var(--ink); }

/* ---------- Table (services scope) ---------- */

.scope-table { width: 100%; border-collapse: collapse; }
.scope-table th, .scope-table td {
  text-align: left;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.scope-table th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--graphite);
  font-weight: 500;
}
.scope-table td:first-child { font-family: var(--serif); font-size: 16px; }
.check { color: var(--redline); font-family: var(--mono); }

/* ---------- Quote / about ---------- */

.pull-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.45;
  max-width: 780px;
  color: var(--ink);
}
.pull-quote::before { content: '"'; color: var(--redline); }
.pull-quote::after { content: '"'; color: var(--redline); }

.credentials { display: flex; flex-direction: column; gap: 22px; }
.credentials .row { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.credentials .row span:first-child { font-family: var(--mono); font-size: 12px; color: var(--graphite); text-transform: uppercase; letter-spacing: 0.05em; }
.credentials .row span:last-child { text-align: right; }

/* ---------- Contact ---------- */

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.field { margin-bottom: 24px; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--graphite);
  margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  padding: 10px 2px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-bottom-color: var(--redline);
}
.field textarea { resize: vertical; min-height: 100px; }
.form-status { margin-top: 18px; font-family: var(--mono); font-size: 12.5px; color: var(--graphite); min-height: 18px; }

.contact-info .row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 30px; }
.contact-info .row span:first-child { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--graphite); }
.contact-info .row span:last-child { font-size: 17px; font-family: var(--serif); }

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

.site-footer {
  padding: 44px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--graphite);
  letter-spacing: 0.03em;
}
.site-footer a:hover { color: var(--ink); }

/* focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--redline);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  :root { --frame-gap: 10px; }
  .site-header { padding: 18px 22px; }
  .main-nav { position: fixed; top: 70px; left: 10px; right: 10px; background: var(--paper); border: 1px solid var(--ink); flex-direction: column; gap: 0; padding: 8px 0; display: none; z-index: 35; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 22px; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; font-family: var(--mono); font-size: 12px; text-transform: uppercase; background: none; border: 1px solid var(--ink); padding: 8px 14px; letter-spacing: 0.06em; }
  .wrap { padding: 0 22px; }
  section { padding: 64px 0; }
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero-drawing { order: -1; }
  .grid-2, .grid-3, .contact-grid { grid-template-columns: 1fr; }
  .grid-3 { border: none; background: none; }
  .grid-3 > * { border: 1px solid var(--line); }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline > div { border-right: none; border-bottom: 1px solid var(--line); }
  .pipeline-connector { display: none; }
}

/* ---------- Blog ---------- */

.search { max-width: 620px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: none;
  color: var(--graphite);
  border: 1px solid var(--line-strong);
  padding: 9px 14px;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.post-list { display: flex; flex-direction: column; gap: 24px; }
.post { border: 1px solid var(--line); padding: 36px; }
.post h2 { font-size: 28px; margin-bottom: 14px; }
.post p { color: var(--graphite); max-width: 720px; margin-top: 12px; }
.post[hidden], #blog-empty[hidden] { display: none; }

/* ---------- Corner marks, at the top and bottom of each page ---------- */
:root { --tick-inset: 10px; --tick-size: 22px; }
.sheet::before, .sheet::after, .sheet .tick-tr, .sheet .tick-bl { width: var(--tick-size); height: var(--tick-size); }
.sheet::before { top: var(--tick-inset); left: var(--tick-inset); }
.sheet .tick-tr { top: var(--tick-inset); right: var(--tick-inset); }
.sheet .tick-bl { bottom: var(--tick-inset); left: var(--tick-inset); }
.sheet::after { bottom: var(--tick-inset); right: var(--tick-inset); }
.sheet-label { bottom: calc(var(--tick-inset) + 6px); right: calc(var(--tick-inset) + var(--tick-size) + 10px); }
.site-footer { padding-bottom: 88px; }
@media (max-width: 900px) {
  :root { --tick-inset: 5px; --tick-size: 16px; }
}

/* ---------- Shared page rhythm (same on every page) ---------- */
.sheet { display: flex; flex-direction: column; }
.sheet > main { flex: 1 0 auto; }
main > section:last-child { border-bottom: none; }
.page-head h1 { font-size: clamp(36px, 4.6vw, 58px); }
h1 + .lede { margin-top: 20px; }
.section-title { margin-bottom: 36px; }
@media (max-width: 900px) {
  .sheet-label { display: none; }
}
@media (max-width: 900px) {
  section, .tight { padding: 48px 0; }
  .hero { padding-top: 32px; padding-bottom: 48px; }
  .hero-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .grid-2, .grid-3 { gap: 16px !important; }
  .grid-2 > .credentials { margin-top: 16px; }
  .card, .post, .grid-3 > * { padding: 28px 24px; }
  .gallery { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .credentials .row { flex-direction: column; gap: 6px; }
  .credentials .row span:last-child { text-align: left; }
  .site-footer { flex-wrap: wrap; justify-content: center; gap: 8px 20px; padding: 32px 22px 48px; }
}
h2 + .lede { margin-top: 18px; }
.page-head h1 + .contact-grid { margin-top: 36px; }

/* ---------- Calls to action, form extras ---------- */
.cta-band h2 { max-width: 640px; margin: 0 auto; }
.cta-band .lede { margin: 16px auto 28px; }
.fine { margin-top: 18px; font-size: 14px; color: var(--graphite); }
.text-link { text-decoration: underline; text-underline-offset: 3px; }
.text-link:hover { color: var(--redline); }
.field label em { font-style: normal; text-transform: none; letter-spacing: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn:disabled { opacity: 0.6; cursor: progress; }
button.btn { cursor: pointer; }
.steps { margin: 10px 0 0 18px; }
.steps li { margin-top: 6px; }
.prose h2 { font-size: 24px; margin-top: 34px; }
.prose p { max-width: 680px; margin-top: 10px; color: var(--graphite); }
/* Phones: drawing stays on top, with less empty space so the headline and button show sooner */
@media (max-width: 900px) {
  .hero { padding-top: 8px; row-gap: 8px; }
  .hero-drawing { margin-bottom: -18px; width: 100%; max-width: 520px; justify-self: center; }
  .hero .eyebrow { margin-bottom: 12px; }
}
.page-head .lede + .contact-grid { margin-top: 40px; }

/* Call-to-action band without a sub-line */
.cta-band h2 + .btn { margin-top: 26px; }

/* Portfolio filters sit directly above the tiles */
section.tight.portfolio-head { border-bottom: none; padding-bottom: 28px; }
section.tight.portfolio-head + section.tight { padding-top: 0; }

/* Contact form: a box that still needs filling out */
.field.invalid input, .field.invalid textarea {
  border: 3px solid var(--redline);
  background: rgba(178, 58, 47, 0.12);
  padding-left: 10px;
  padding-right: 10px;
}

/* ---------- Selected and hovered: same blood orange tint everywhere ---------- */
:root { --redline-tint: rgba(178, 58, 47, 0.12); }
.field.invalid input, .field.invalid textarea { background: var(--redline-tint); }
.main-nav a { padding: 7px 10px; }
.main-nav a[aria-current="page"] { background: var(--redline-tint); }
.main-nav a[aria-current="page"]::after { left: 0; right: 0; bottom: 0; }
@media (min-width: 901px) and (hover: hover) {
  .main-nav a:hover::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--redline); }
}
@media (min-width: 901px) {
  .main-nav a:focus-visible::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--redline); }
}
.main-nav a:focus-visible { background: var(--redline-tint); }
.chip[aria-pressed="true"] { background: var(--redline-tint); border-color: var(--redline); color: var(--ink); }
.nav-toggle[aria-expanded="true"] { background: var(--redline-tint); border-color: var(--redline); }
.field input:focus, .field textarea:focus, .field select:focus { background: var(--redline-tint); }
@media (hover: hover) {
  .main-nav a:hover, .chip:hover, .site-footer a:hover, .text-link:hover, .contact-info a:hover { background: var(--redline-tint); color: var(--ink); }
  .nav-toggle:hover, .field input:hover, .field textarea:hover, .field select:hover { background: var(--redline-tint); }
  .btn:not(.btn-accent):hover { background: var(--redline-tint); border-color: var(--redline); color: var(--ink); }
}
@media (min-width: 901px) {
  .main-nav { gap: 14px; }
}
@media (max-width: 900px) {
  .main-nav a { padding: 14px 22px; }
  .main-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--redline); }
  .main-nav a[aria-current="page"]::after { display: none; }
}
