/* ==========================================================================
   C&C Woodworks — global stylesheet
   Edit colors, fonts and spacing here. Everything on the site reads from it.
   ========================================================================== */

:root {
  /* Palette — warm neutral */
  --bone:      #F7F5F1;   /* page background */
  --bone-2:    #EDE9E2;   /* image placeholders, subtle fills */
  --ink:       #1A1815;   /* headings, primary text */
  --ink-soft:  #6B6459;   /* secondary text */
  --line:      rgba(26, 24, 21, 0.13);
  --oak:       #A9743F;   /* accent — used sparingly */

  /* Layout */
  --sidebar-w: 264px;
  --pad:       clamp(24px, 4vw, 64px);

  /* Type */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

img { display: block; max-width: 100%; }

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

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

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  padding: 40px 32px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background: var(--bone);
  z-index: 100;
}

.wordmark { display: block; }

.wordmark .mark {
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0.01em;
  display: block;
}

.wordmark .name {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav li + li { margin-top: 14px; }

.nav a {
  display: inline-block;
  position: relative;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.25s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }

.nav a.is-active { color: var(--ink); }
.nav a.is-active::after { transform: scaleX(1); }

/* Instagram icon — sits under Contact, no underline animation */
.nav li.ig-item { margin-top: 26px; }

.nav a.ig {
  display: inline-flex;
  align-items: center;
  color: var(--ink-soft);
  opacity: 0.75;
  transition: opacity 0.25s ease, color 0.25s ease;
}
.nav a.ig::after { display: none; }
.nav a.ig:hover { color: var(--ink); opacity: 1; }
.nav a.ig svg { display: block; }

.sidebar-foot {
  font-size: 11px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.sidebar-foot a:hover { color: var(--ink); }

.sidebar-foot .rule {
  height: 1px;
  background: var(--line);
  margin-bottom: 16px;
}

/* Mobile bar (hidden on desktop) */
.mobilebar { display: none; }

/* --------------------------------------------------------------------------
   Main column
   -------------------------------------------------------------------------- */

.main { margin-left: var(--sidebar-w); }

.section { padding: clamp(56px, 8vw, 120px) var(--pad); }
.section--tight { padding-top: clamp(40px, 5vw, 64px); }

.wrap { max-width: 1180px; }
.wrap--narrow { max-width: 720px; }

/* --------------------------------------------------------------------------
   Type
   -------------------------------------------------------------------------- */

.eyebrow {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 22px;
}

h1, h2, h3 { font-weight: 400; margin: 0; }

.display {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 1.06;
  letter-spacing: -0.01em;
}

.title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.12;
}

.lede {
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.6;
  color: var(--ink);
  max-width: 40ch;
}

.body p { color: var(--ink-soft); max-width: 62ch; }
.body p + p { margin-top: 1.2em; }

.link {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  transition: border-color 0.25s ease;
}

.link:hover { border-color: var(--ink); }

/* --------------------------------------------------------------------------
   Hero (home)
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  height: 100vh;
  min-height: 520px;
  overflow: hidden;
  background: var(--bone-2);
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 18, 15, 0.55), rgba(20, 18, 15, 0) 45%);
  pointer-events: none;
}

.hero-copy {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: clamp(40px, 7vw, 80px);
  z-index: 2;
  color: #fff;
}

.hero-copy .display { color: #fff; max-width: 16ch; }

/* --------------------------------------------------------------------------
   Work grid
   -------------------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 1.4vw, 20px);
}

.grid--two { grid-template-columns: repeat(2, 1fr); }

.tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bone-2);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 15, 0.42);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.tile-label {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.tile-label .t {
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.2;
}

.tile-label .m {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.8;
}

.tile:hover img { transform: scale(1.045); }
.tile:hover::after { opacity: 1; }
.tile:hover .tile-label { opacity: 1; transform: none; }

/* Touch devices: no hover, so keep the title always readable */
@media (hover: none) {
  .tile::after { opacity: 1; background: rgba(20, 18, 15, 0.28); }
  .tile-label { opacity: 1; transform: none; align-items: flex-start; justify-content: flex-end; text-align: left; }
}

/* --------------------------------------------------------------------------
   Project detail
   -------------------------------------------------------------------------- */

.back {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.back:hover { color: var(--ink); }

.project-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
  margin: 32px 0 clamp(36px, 5vw, 64px);
}

.meta {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 24px;
  font-size: 13px;
}
.meta dt {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 3px;
}
.meta dd { margin: 0; }

.shot {
  background: var(--bone-2);
  margin-bottom: clamp(10px, 1.4vw, 20px);
}
.shot img { width: 100%; }

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: clamp(40px, 5vw, 72px);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.project-nav a:hover { color: var(--ink); }

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.split img { width: 100%; background: var(--bone-2); }

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.list li {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  font-size: 14px;
  color: var(--ink-soft);
}

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

.form-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

.form-layout { max-width: 960px; }

.form { max-width: 620px; }

/* Success / error messages */
.form-note {
  margin: 0 0 28px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.6;
  border-left: 2px solid var(--oak);
  background: rgba(169, 116, 63, 0.07);
}
.form-note--err {
  border-left-color: #A5453A;
  background: rgba(165, 69, 58, 0.07);
}

/* After a successful send, only the thank-you note remains */
.form.is-sent .field,
.form.is-sent .field-row,
.form.is-sent .btn { display: none; }

.btn[disabled] { opacity: 0.45; cursor: default; }
.btn[disabled]:hover { background: var(--ink); color: var(--bone); }

.field { margin-bottom: 26px; }

.field label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  font-weight: 300;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  border-radius: 0;
  transition: border-color 0.25s ease;
  appearance: none;
}

.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

.field select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236B6459'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}

.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 16px 38px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.btn:hover { background: transparent; color: var(--ink); }

.aside {
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-soft);
}
.aside h3 {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}
.aside .block + .block { margin-top: 26px; }
.aside a:hover { color: var(--ink); }

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

.endnote {
  border-top: 1px solid var(--line);
  padding: 28px var(--pad);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

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

@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .project-head { grid-template-columns: 1fr; align-items: start; }
  .split { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .main { margin-left: 0; padding-top: 60px; }

  .sidebar {
    top: 60px;
    width: 100%;
    height: auto;
    bottom: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 24px var(--pad) 32px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .sidebar .wordmark { display: none; }
  .sidebar .nav a { font-size: 14px; }
  .sidebar .nav li + li { margin-top: 18px; }
  .sidebar-foot { margin-top: 28px; }

  body.nav-open .sidebar {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .mobilebar {
    display: flex;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--pad);
    background: var(--bone);
    border-bottom: 1px solid var(--line);
    z-index: 110;
  }

  .mobilebar .wordmark .mark { font-size: 24px; }
  .mobilebar .wordmark .name { margin-top: 2px; font-size: 8px; }

  .navtoggle {
    background: none;
    border: 0;
    padding: 8px 0 8px 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink);
  }

  .hero { height: calc(100vh - 60px); }
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
