:root {
  --dm-ink: #17211b;
  --dm-muted: #607068;
  --dm-forest: #163f31;
  --dm-forest-dark: #102f25;
  --dm-lime: #d9ff73;
  --dm-paper: #f5f4f0;
  --dm-white: #fff;
  --dm-line: rgba(23, 33, 27, .14);
  --dm-shadow: 0 18px 50px rgba(17, 46, 35, .08);
  --dm-radius: 22px;
}

html { scroll-behavior: smooth; }
body { background: var(--dm-paper); color: var(--dm-ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 17px; line-height: 1.7; }
a { color: var(--dm-forest); text-underline-offset: 3px; }
a:hover, a:focus { color: #276f56; }
img { border-radius: 14px; }
.container { max-width: 1180px; }

/* Global header */
#topnavi-wrap { display: none; }
#header-wrap { background: var(--dm-forest-dark); border: 0; }
#header { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 2.2rem 1.5rem; }
#logo { float: none; }
#logo .site-title, #logo .site-title a, #logo h1, #logo h1 a { color: var(--dm-white); font-size: clamp(1.7rem, 4vw, 2.65rem); font-weight: 850; letter-spacing: -.045em; line-height: 1; text-decoration: none; }
#logo .site-description, #logo .site-description p, #logo .site-tagline { color: rgba(255,255,255,.66); font-size: .92rem; margin-top: .7rem; }
#header-content { display: flex; align-items: center; gap: 1rem; margin: 0; }
#header-social-icons { margin: 0; }
#header-social-icons a { color: var(--dm-white); opacity: .76; }
#header-social-icons a:hover { opacity: 1; }
#header-search { display: none; }

/* Navigation */
#navi-wrap { background: var(--dm-forest); border: 0; box-shadow: 0 8px 30px rgba(12,38,29,.16); position: relative; z-index: 20; }
#mainnav { padding: 0 1rem; }
#mainnav-menu { display: flex; align-items: center; flex-wrap: wrap; gap: .15rem; }
#mainnav-menu li { border: 0; }
#mainnav-menu a { color: rgba(255,255,255,.78); font-size: .8rem; font-weight: 800; letter-spacing: .035em; padding: 1rem .9rem; text-transform: uppercase; transition: color .2s ease, background .2s ease; }
#mainnav-menu a:hover, #mainnav-menu .current-menu-item > a { background: rgba(255,255,255,.08); color: var(--dm-lime); }

/* Shared content layout */
#wrap { padding: clamp(2.5rem, 6vw, 6rem) 1.25rem; }
#content.primary { float: none; width: 100%; max-width: 920px; margin: 0 auto; }
#sidebar, #wrap > .secondary, #wrap > .widget-area, body:not(.home) #wrap > aside { display: none !important; }
.page-template-default #content, .single #content { max-width: 820px; }
.entry, .entry-content { color: #28352e; }
.entry p, .entry li { max-width: 72ch; }
.entry p { margin: 0 0 1.25rem; }
.entry ul, .entry ol { margin: 0 0 1.5rem 1.4rem; }
.entry li { margin: .35rem 0; }
.entry h2, .entry h3, .entry h4 { color: var(--dm-ink); letter-spacing: -.025em; line-height: 1.15; margin: 2.2rem 0 .8rem; }
.entry h2 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); }
.entry h3 { font-size: clamp(1.3rem, 2.6vw, 1.8rem); }
.entry blockquote { background: #e8eee9; border-left: 5px solid var(--dm-forest); border-radius: 0 14px 14px 0; color: #2d4036; margin: 2rem 0; padding: 1.25rem 1.5rem; }
.entry table { border: 1px solid var(--dm-line); border-collapse: separate; border-radius: 14px; border-spacing: 0; display: block; max-width: 100%; overflow-x: auto; }
.entry td, .entry th { border-color: var(--dm-line); padding: .8rem 1rem; }

/* Page and post headers */
.page:not(.home) .post-title, .single .post-title { color: var(--dm-ink); font-size: clamp(2.25rem, 6vw, 4.8rem); font-weight: 850; letter-spacing: -.055em; line-height: 1.02; margin: 0 0 1.25rem; text-transform: none; }
.single .entry-meta, .single .postmeta { color: var(--dm-muted); font-size: .82rem; margin-bottom: 2rem; text-transform: uppercase; letter-spacing: .06em; }
.single .entry-meta a { color: inherit; }
.single #content > article, .page-template-default #content > article, .page-template-default #content > .page { background: var(--dm-white); border: 1px solid var(--dm-line); border-radius: var(--dm-radius); box-shadow: var(--dm-shadow); padding: clamp(1.4rem, 5vw, 4rem); }
.single .postinfo { border-top: 1px solid var(--dm-line); color: var(--dm-muted); margin-top: 3rem; padding-top: 1.2rem; }

/* Blog archive */
body.blog #content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; max-width: 1080px; }
body.blog #content::before { content: "Blogg\A Erfaringer, prosjekter og refleksjoner"; white-space: pre-wrap; grid-column: 1 / -1; color: var(--dm-ink); font-size: clamp(2.6rem, 7vw, 5.6rem); font-weight: 850; letter-spacing: -.055em; line-height: 1.03; margin: 0 0 2rem; overflow-wrap: anywhere; }
body.blog .content-excerpt { background: var(--dm-white); border: 1px solid var(--dm-line); border-radius: var(--dm-radius); box-shadow: var(--dm-shadow); display: flex; flex-direction: column; margin: 0; overflow: hidden; padding: 1.45rem; }
body.blog .content-excerpt .entry-title { font-size: clamp(1.35rem, 2.5vw, 1.9rem); letter-spacing: -.035em; line-height: 1.14; margin: 0 0 .8rem; text-transform: none; }
body.blog .content-excerpt .entry-title a { color: var(--dm-ink); text-decoration: none; }
body.blog .content-excerpt .entry-title a:hover { color: var(--dm-forest); }
body.blog .content-excerpt .postmeta { color: var(--dm-muted); font-size: .72rem; letter-spacing: .04em; margin-bottom: 1rem; text-transform: uppercase; }
body.blog .content-excerpt > a { order: -1; margin: -1.45rem -1.45rem 1.25rem; }
body.blog .content-excerpt > a img { aspect-ratio: 16 / 8.7; border-radius: 0; height: auto; object-fit: cover; width: 100%; }
body.blog .content-excerpt .entry { color: var(--dm-muted); font-size: .96rem; }
body.blog .content-excerpt .more-link { display: inline-flex; background: var(--dm-forest); border-radius: 999px; color: white; font-size: .78rem; font-weight: 800; margin-top: .75rem; padding: .55rem .85rem; text-decoration: none; text-transform: uppercase; }
body.blog .content-excerpt .postinfo { display: none; }
body.blog .post-pagination { grid-column: 1 / -1; padding: 2rem 0; text-align: center; }

/* Project and profile pages */
.page-id-47 .entry > p:first-child, .page-id-476 .entry > p:first-child { font-size: 1.16rem; color: var(--dm-muted); }
.page-id-476 .entry a { font-weight: 750; }
.page-id-336 .entry h2, .page-id-336 .entry h3 { border-bottom: 1px solid var(--dm-line); padding-bottom: .55rem; }

/* Complete project portfolio */
.page-id-476 #content { max-width: 1120px; }
.page-id-476 #content > article { background: transparent; border: 0; box-shadow: none; padding: 0; }
.page-id-476 .post-title { max-width: 900px; margin-bottom: 2rem; }
.dm-portfolio-intro { background: var(--dm-forest); border-radius: 28px; color: rgba(255,255,255,.82); margin-bottom: clamp(3rem,7vw,7rem); padding: clamp(2rem,6vw,5rem); }
.dm-portfolio-intro .dm-kicker { color: var(--dm-lime); }
.dm-portfolio-intro h2 { color: white; font-size: clamp(2rem,5vw,4.6rem); max-width: 900px; }
.dm-portfolio-intro p:last-child { font-size: 1.12rem; max-width: 760px; }
.dm-project-group { margin: 0 0 clamp(4rem,8vw,7rem); }
.dm-group-heading { align-items: baseline; border-bottom: 1px solid var(--dm-line); display: flex; gap: 1rem; margin-bottom: 1.4rem; padding-bottom: .9rem; }
.dm-group-heading p { color: #76867e; font-size: .74rem!important; font-weight: 850; letter-spacing: .14em; margin: 0!important; }
.dm-group-heading h2 { border: 0!important; font-size: clamp(1.65rem,3.8vw,2.8rem)!important; margin: 0!important; padding: 0!important; }
.dm-project-grid { display: grid; gap: 1rem; grid-template-columns: repeat(3,minmax(0,1fr)); }
.dm-project-card { background: var(--dm-white); border: 1px solid var(--dm-line); border-radius: 18px; box-shadow: var(--dm-shadow); display: flex; flex-direction: column; min-height: 300px; padding: 1.45rem; }
.dm-project-card > span { color: #61736a; font-size: .68rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.dm-project-card h3 { font-size: 1.45rem!important; margin: .65rem 0 .7rem!important; }
.dm-project-card p { color: var(--dm-muted); font-size: .94rem!important; line-height: 1.6; }
.dm-project-card > div { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: auto; padding-top: 1rem; }
.dm-project-card a { color: var(--dm-forest); font-size: .82rem; font-weight: 850!important; text-decoration: none; }
.dm-project-card a:hover { text-decoration: underline; }
.dm-project-historic { background: #eeece5; box-shadow: none; }

/* Footer */
#footer-wrap { background: var(--dm-forest-dark); border: 0; margin-top: clamp(3rem, 8vw, 8rem); }
#footer { min-height: 180px; display: flex; align-items: center; justify-content: center; padding: 3rem 1.25rem; text-align: center; }
#footer-text { color: rgba(255,255,255,.62); font-size: .82rem; }
#footer-text a { color: var(--dm-lime); }

/* Focus and motion */
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--dm-lime); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

@media (max-width: 800px) {
  body { font-size: 16px; }
  #header { min-height: 120px; padding: 1.65rem 1.1rem; }
  #header-content { display: none; }
  #mainnav { padding: 0; }
  #mainnav-menu { gap: 0; }
  #mainnav-menu a { padding: .76rem 1.1rem; }
  #wrap { padding: 2rem .9rem 4rem; }
  body.blog #content { grid-template-columns: 1fr; }
  body.blog #content::before { margin-bottom: 1rem; }
  .single #content > article, .page-template-default #content > article, .page-template-default #content > .page { border-radius: 16px; padding: 1.25rem; }
  .page:not(.home) .post-title, .single .post-title { font-size: clamp(2rem, 10vw, 3.4rem); }
  .dm-project-grid { grid-template-columns: 1fr; }
  .dm-project-card { min-height: 240px; }
  .dm-portfolio-intro { border-radius: 18px; padding: 2rem 1.3rem; }
}
