/* ============ Byggmester Sande & Koch ============ */

:root {
  --bg: #14120f;
  --bg-raise: #1c1915;
  --text: #f2eee7;
  --muted: #a89f92;
  --accent: #e0a43c;
  --accent-dark: #b98322;
  --max: 1100px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }

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

h1, h2, h3 {
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.75rem, 8vw, 5.5rem); }
h2 { font-size: clamp(2rem, 5vw, 3.25rem); }
h3 { font-size: 1.35rem; }

a { color: var(--accent); }

.kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.kicker::before {
  content: "";
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
}

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

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--pad);
  background: linear-gradient(to bottom, rgba(20, 18, 15, 0.85), rgba(20, 18, 15, 0.55) 70%, transparent);
}

.wordmark {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  line-height: 1.15;
}
.wordmark-small {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}
.wordmark-large {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.site-nav a {
  position: relative;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.25rem 0;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a.nav-cta { color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 0.5rem;
  cursor: pointer;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
}

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

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  filter: brightness(0.62) saturate(0.9);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, var(--bg) 0%, rgba(20, 18, 15, 0.3) 45%, rgba(20, 18, 15, 0.5) 100%);
}

.hero-inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 8rem var(--pad) clamp(4.5rem, 12vh, 8rem);
}

.hero-sub {
  margin: 1.5rem 0 2.25rem;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  max-width: 34ch;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1rem 2.5rem;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

/* ---------- Sections ---------- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(5rem, 12vw, 9rem) var(--pad) 0;
}

.section-head { max-width: 44ch; margin-bottom: clamp(2.5rem, 6vw, 4rem); }

.section--wide { max-width: none; padding-left: 0; padding-right: 0; }
.section--wide .section-head,
.section--wide .projects-more {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ---------- Tjenester ---------- */

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
}

.service { position: relative; padding-top: 1.5rem; }
.service::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2.5rem;
  height: 3px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.service:hover::before { width: 100%; }

.service-num {
  display: block;
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--muted);
  margin-bottom: 1rem;
}
.service:hover .service-num { -webkit-text-stroke-color: var(--accent); }

.service h3 { margin-bottom: 0.6rem; }
.service p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Om oss ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.about-photo { position: relative; isolation: isolate; }
.about-accent {
  position: absolute;
  inset: 1.5rem -1.5rem -1.5rem 1.5rem;
  background: var(--accent);
  z-index: -1;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }

.about-text p { color: var(--muted); margin-top: 1.1rem; }
.about-text h2 { margin-bottom: 0.25rem; }

/* ---------- Prosjekter ---------- */

.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.project {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  isolation: isolate;
}
.project img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  transition: transform 0.5s ease, filter 0.5s ease;
  filter: brightness(0.9);
}
.project:hover img { transform: scale(1.05); filter: brightness(1); }

.project-info {
  position: absolute;
  inset: auto 0 0 0;
  padding: 4rem 1.75rem 1.6rem;
  background: linear-gradient(to top, rgba(10, 9, 7, 0.92), transparent);
}
.project-info h3 {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.project-info h3::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  background: var(--accent);
  margin-top: 0.6rem;
}
.project-info p {
  color: #d8d2c8;
  font-size: 0.9rem;
  margin-top: 0.6rem;
  max-width: 34ch;
}

.projects-more {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Kontakt ---------- */

.contact-lead { color: var(--muted); margin-top: 0.75rem; }

.contact-label {
  display: block;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.contact-big {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.contact-phones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.phone-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid #3a3227;
  border-radius: 12px;
  background: var(--bg-raise);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.phone-details { display: grid; gap: 0.3rem; }
.phone-name {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.phone-number {
  color: var(--muted);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.phone-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 700;
}
.phone-action svg { width: 18px; height: 18px; flex: none; }
.phone-card:hover { border-color: var(--accent); background: #252018; }
.phone-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
@media (max-width: 720px) {
  .contact-phones { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .phone-card { transition: none; }
}

.contact-line { text-decoration: none; }
.contact-line .contact-value {
  display: inline-block;
  font-size: clamp(1.9rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  transition: color 0.2s ease, transform 0.2s ease;
}
.contact-line:hover .contact-value {
  color: var(--accent);
  transform: translateX(0.5rem);
}

.contact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 4rem;
}
.contact-sub { color: var(--text); font-weight: 600; }
.contact-sub a { color: var(--text); text-decoration-color: var(--accent); }
.contact-sub a:hover { color: var(--accent); }

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

.site-footer {
  margin-top: clamp(5rem, 12vw, 9rem);
  padding: 0 var(--pad) 2.5rem;
  text-align: center;
  overflow: hidden;
}

.footer-ghost {
  /* Keep the full name inside the footer, including on narrow phones. */
  font-size: min(8vw, 10rem);
  /* Apple's system font exposes overlapping contours when stroked. */
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-synthesis: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px #35302a;
  user-select: none;
  margin-bottom: 2.5rem;
}

.footer-tagline {
  color: var(--muted);
  max-width: 55ch;
  margin: 0 auto 1.25rem;
  font-size: 0.95rem;
}
.footer-meta { color: var(--muted); font-size: 0.85rem; }

/* ---------- Reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Mobile ---------- */

@media (max-width: 860px) {
  .projects { grid-template-columns: 1fr; }
  .project { aspect-ratio: 4 / 3; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .site-header { background: rgba(20, 18, 15, 0.92); }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-raise);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 1rem var(--pad); }
  .site-nav a::after { display: none; }

  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-height: 440px; margin-right: 1.5rem; }
  .about-accent { inset: 1rem -1rem -1rem 1rem; }
}
