/* ============================================================
   Sandstone Studio — style.css
   Palette: warm paper + pencil ink + sandstone amber
   ============================================================ */

:root {
  --paper:       #f7f3ea;
  --paper-mid:   #ede8db;
  --paper-dark:  #e3ddd0;
  --ink:         #2a2520;
  --ink-mid:     #6b6258;
  --ink-light:   #a8a09a;
  --sandstone:   #8b7355;
  --amber:       #c17f3c;
  --rule:        #ccc5b5;
  --white:       #ffffff;
  --shadow:      rgba(42,37,32,0.13);
  --shadow-soft: rgba(42,37,32,0.07);

  --font-sketch: 'Caveat', cursive;
  --font-body:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-w: 1100px;
  --pad: clamp(20px, 4vw, 32px);
  --section-y: clamp(60px, 8vw, 100px);
}

/* === Reset ================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* === Base ================================================== */
body {
  font-family: var(--font-body);
  background-color: var(--paper);
  /* Subtle graph-paper grid */
  background-image:
    linear-gradient(rgba(42,37,32,0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42,37,32,0.032) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === Layout ================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
}
section { padding: var(--section-y) 0; }

/* === Typography ============================================ */
h1, h2, h3, .logo, .footer-name {
  font-family: var(--font-sketch);
  line-height: 1.15;
  color: var(--ink);
}
h1           { font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 700; }
.section-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; margin-bottom: 0.4em; }
h3           { font-size: 1.5rem; font-weight: 600; }
p            { color: var(--ink-mid); line-height: 1.7; }
.section-sub { font-size: 1.05rem; max-width: 580px; margin-bottom: 48px; }

/* === Navigation ============================================ */
#nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(247,243,234,0.93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.65rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
  color: var(--ink);
}
nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  align-items: center;
}
nav ul a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-mid);
  transition: color 0.18s;
}
nav ul a:hover { color: var(--ink); }
.nav-cta {
  background: var(--ink) !important;
  color: var(--paper) !important;
  padding: 8px 18px;
  border-radius: 2px;
  transition: background 0.18s !important;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--sandstone) !important; }

/* === Hero ================================================== */
#hero {
  min-height: calc(100vh - 58px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(48px, 8vh, 80px) var(--pad) 40px;
}
.hero-content {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sandstone);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.hero-text h1 { margin-bottom: 20px; }
.hero-sub {
  font-size: 1.05rem;
  color: var(--ink-mid);
  margin-bottom: 36px;
  line-height: 1.75;
}

/* CTA Button */
.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  padding: 13px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 2px;
  letter-spacing: 0.02em;
  transition: background 0.18s, transform 0.12s;
  border: none;
}
.btn:hover { background: var(--sandstone); transform: translateY(-2px); }

/* Photo frame — polaroid-ish */
.photo-frame {
  background: var(--white);
  padding: 8px;
  padding-bottom: 36px;
  box-shadow: 3px 5px 18px var(--shadow), 0 1px 4px var(--shadow-soft);
  position: relative;
}
/* Tape accent at top */
.photo-frame::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 10px;
  background: rgba(193,127,60,0.28);
  border-radius: 0 0 3px 3px;
}
.hero-frame {
  transform: rotate(1.4deg);
  max-width: 460px;
  margin-left: auto;
}
/* Placeholder when hero image is missing */
.photo-frame.empty {
  min-height: 280px;
  background: var(--paper-mid);
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-frame.empty::after {
  content: 'photo coming soon';
  font-family: var(--font-sketch);
  font-size: 1.3rem;
  color: var(--ink-light);
}
.photo-frame.empty img { display: none; }

.scroll-cue {
  text-align: center;
  color: var(--ink-light);
  font-size: 1.5rem;
  margin-top: clamp(24px, 4vh, 48px);
  animation: nudge 2.2s ease-in-out infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(7px); opacity: 1; }
}

/* === Section wave dividers ================================= */
.rule-wave {
  overflow: hidden;
  line-height: 0;
  height: 24px;
}
.rule-wave svg { width: 100%; height: 24px; display: block; }

/* === Services ============================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.card {
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--rule);
  padding: 32px;
  position: relative;
}
/* Offset shadow border (double-border sketch effect) */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  translate: 4px 4px;
  border: 1px solid var(--rule);
  z-index: -1;
  pointer-events: none;
}
.card-icon {
  width: 60px;
  height: 60px;
  color: var(--sandstone);
  margin-bottom: 20px;
}
.card-icon svg { width: 100%; height: 100%; }
.card h3 { margin-bottom: 10px; }
.card p { font-size: 0.95rem; margin-bottom: 18px; }

.spec-list {
  list-style: none;
  border-top: 1px dashed var(--rule);
}
.spec-list li {
  font-size: 0.85rem;
  color: var(--ink-mid);
  padding: 5px 0;
  border-bottom: 1px dashed var(--rule);
  font-variant-numeric: tabular-nums;
}

/* === Work / Gallery ======================================== */
#work { background: rgba(237,232,219,0.35); }

.gallery-grid {
  columns: 3 180px;
  column-gap: 18px;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 18px;
  cursor: pointer;
}
.gallery-frame {
  background: var(--white);
  padding: 7px;
  padding-bottom: 28px;
  box-shadow: 2px 4px 14px var(--shadow);
  position: relative;
  transition: transform 0.22s, box-shadow 0.22s;
}
.gallery-frame::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 9px;
  background: rgba(193,127,60,0.25);
  border-radius: 0 0 3px 3px;
}
.gallery-frame img { width: 100%; height: auto; }
.gallery-caption {
  font-family: var(--font-sketch);
  font-size: 0.95rem;
  color: var(--ink-mid);
  text-align: center;
  padding: 8px 6px 0;
  line-height: 1.3;
}

/* Vary rotation per item */
.gallery-item:nth-child(4n+1) .gallery-frame { transform: rotate(-1.3deg); }
.gallery-item:nth-child(4n+2) .gallery-frame { transform: rotate(0.9deg); }
.gallery-item:nth-child(4n+3) .gallery-frame { transform: rotate(-0.5deg); }
.gallery-item:nth-child(4n+4) .gallery-frame { transform: rotate(1.6deg); }

.gallery-item:hover .gallery-frame {
  transform: rotate(0deg) scale(1.03) !important;
  box-shadow: 5px 10px 24px var(--shadow);
  z-index: 2;
}
.gallery-empty {
  text-align: center;
  padding: 64px 20px;
  font-family: var(--font-sketch);
  font-size: 1.3rem;
  color: var(--ink-light);
}

/* === Process =============================================== */
.process-steps {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 40px;
}
.process-step {
  flex: 1;
  background: rgba(255,255,255,0.45);
  border: 1px solid var(--rule);
  padding: 28px;
}
.step-num {
  font-family: var(--font-sketch);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--rule);
  line-height: 1;
  margin-bottom: 10px;
}
.process-step h3 { margin-bottom: 10px; }
.process-step p { font-size: 0.95rem; }
.process-arrow {
  flex-shrink: 0;
  width: 48px;
  color: var(--sandstone);
  margin-top: 52px;
  opacity: 0.7;
}
.process-arrow svg { width: 100%; }
.process-note {
  text-align: center;
  font-size: 0.95rem;
  color: var(--ink-mid);
}
.process-note a {
  color: var(--sandstone);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* === Contact =============================================== */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 60px;
  align-items: center;
}
.contact-text p { max-width: 500px; margin-bottom: 16px; }
.contact-btn { margin: 8px 0 20px; }
.contact-note { font-size: 0.85rem; color: var(--ink-light); margin-top: 12px !important; }
.contact-deco svg { width: 100%; height: auto; opacity: 0.45; }

/* === Footer ================================================ */
footer {
  border-top: 1px solid var(--rule);
  padding: 24px 0;
  background: rgba(237,232,219,0.55);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-name { font-size: 1.25rem; font-weight: 700; }
.footer-tagline { font-size: 0.8rem; color: var(--ink-light); }

/* === Lightbox ============================================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(28,24,20,0.94);
  z-index: 500;
  align-items: center;
  justify-content: center;
  display: flex;
}
.lb-figure {
  max-width: min(90vw, 900px);
  text-align: center;
}
.lb-figure img {
  max-height: 80vh;
  width: auto;
  max-width: 100%;
  background: var(--white);
  padding: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
#lb-cap {
  font-family: var(--font-sketch);
  font-size: 1.1rem;
  color: var(--paper-dark);
  margin-top: 14px;
}
.lb-close, .lb-prev, .lb-next {
  position: fixed;
  background: transparent;
  border: none;
  color: rgba(247,243,234,0.75);
  font-size: 2.5rem;
  line-height: 1;
  padding: 12px;
  transition: color 0.15s, transform 0.12s;
}
.lb-close { top: 12px; right: 16px; font-size: 2.8rem; }
.lb-prev  { left: 16px;  top: 50%; transform: translateY(-50%); font-size: 3.5rem; }
.lb-next  { right: 16px; top: 50%; transform: translateY(-50%); font-size: 3.5rem; }
.lb-close:hover { color: var(--paper); }
.lb-prev:hover  { color: var(--paper); transform: translateY(-50%) translateX(-3px); }
.lb-next:hover  { color: var(--paper); transform: translateY(-50%) translateX(3px); }

/* === Responsive ============================================ */
@media (max-width: 860px) {
  .hero-content    { grid-template-columns: 1fr; }
  .hero-frame      { max-width: 340px; margin: 0 auto; }
  .services-grid   { grid-template-columns: 1fr; max-width: 520px; }
  .process-steps   { flex-direction: column; }
  .process-arrow   { transform: rotate(90deg); margin: 0 auto; width: 36px; }
  .contact-layout  { grid-template-columns: 1fr; }
  .contact-deco    { display: none; }
}

@media (max-width: 600px) {
  :root { --section-y: 52px; }
  nav ul { gap: 16px; }
  .nav-cta { display: none; }
  .gallery-grid { columns: 2 140px; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 400px) {
  .gallery-grid { columns: 1; }
}

/* === Print ================================================= */
@media print {
  #nav, .lightbox, .scroll-cue { display: none; }
  body { background: white; }
}
