: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); }

@media (min-width: 801px) {
  #navi-wrap { position: sticky; top: 0; }
  .admin-bar #navi-wrap { top: 32px; }
}

/* 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; }
.home .page-title { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
.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; }
.dm-archive-note { background: #eef3ee; border: 1px solid #d5dfd7; border-radius: 18px; margin-top: 3rem; padding: clamp(1.25rem, 4vw, 2rem); }
.dm-archive-note .dm-archive-label { color: var(--dm-forest); font-size: .72rem; font-weight: 850; letter-spacing: .12em; margin: 0 0 .65rem; text-transform: uppercase; }
.dm-archive-note h2 { font-size: clamp(1.45rem, 3vw, 2rem); margin: 0 0 .75rem; }
.dm-archive-note p { color: var(--dm-muted); margin-bottom: 1.1rem; }
.dm-archive-note nav { display: flex; flex-wrap: wrap; gap: .65rem; }
.dm-archive-note nav a { background: var(--dm-forest); border-radius: 999px; color: #fff; font-size: .78rem; font-weight: 800; padding: .58rem .85rem; text-decoration: none; }
.dm-archive-note nav a:hover { background: var(--dm-forest-dark); color: var(--dm-lime); }

/* 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; }

/* About Didrik */
.page-id-47 #content { max-width: 1120px; }
.page-id-47 #content > article { background: transparent; border: 0; box-shadow: none; padding: 0; }
.page-id-47 .post-title { max-width: 900px; margin-bottom: 2rem; }
.dm-profile { color: var(--dm-ink); }
.dm-profile .dm-kicker { color: #577165; font-size: .72rem; font-weight: 850; letter-spacing: .15em; margin: 0 0 .8rem; text-transform: uppercase; }
.dm-profile h2 { font-size: clamp(2rem, 5vw, 4.6rem); margin: 0 0 1rem; }
.dm-profile-hero { align-items: center; background: var(--dm-forest); border-radius: 28px; color: rgba(255,255,255,.82); display: grid; gap: clamp(2rem,6vw,6rem); grid-template-columns: minmax(0,1fr) minmax(180px,.38fr); margin-bottom: clamp(3rem,7vw,7rem); overflow: hidden; padding: clamp(2rem,6vw,5rem); }
.dm-profile-hero .dm-kicker { color: var(--dm-lime); }
.dm-profile-hero h2 { color: white; max-width: 850px; }
.dm-profile-lead { font-size: clamp(1.05rem,1.8vw,1.25rem); max-width: 720px!important; }
.dm-profile-mark { justify-self: end; width: min(100%,260px); }
.dm-profile-mark img { border-radius: 28%; box-shadow: 0 22px 70px rgba(0,0,0,.18); width: 100%; }
.dm-profile-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }
.dm-profile-actions a, .dm-profile-contact > a { align-items: center; border: 1px solid rgba(255,255,255,.42); border-radius: 999px; color: white; display: inline-flex; font-size: .8rem; font-weight: 850!important; min-height: 44px; padding: .68rem 1rem; text-decoration: none; }
.dm-profile-actions .dm-profile-primary, .dm-profile-contact > a { background: var(--dm-lime); border-color: var(--dm-lime); color: var(--dm-forest-dark); }
.dm-profile-section { border-bottom: 1px solid var(--dm-line); padding: clamp(3rem,7vw,6rem) 0; }
.dm-profile-story { display: grid; gap: clamp(2rem,6vw,6rem); grid-template-columns: .8fr 1.2fr; }
.dm-profile-story p { font-size: 1.06rem; }
.dm-profile-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 2.2rem; }
.dm-profile-grid article { background: white; border: 1px solid var(--dm-line); border-radius: 18px; display: flex; flex-direction: column; min-height: 270px; padding: 1.5rem; }
.dm-profile-grid article > span { color: #6b8075; font-size: .7rem; font-weight: 850; letter-spacing: .12em; }
.dm-profile-grid h3 { font-size: 1.5rem; margin: .7rem 0; }
.dm-profile-grid p { color: var(--dm-muted); }
.dm-profile-grid a { font-size: .82rem; font-weight: 850!important; margin-top: auto; text-decoration: none; }
.dm-profile-voice blockquote { background: transparent; border: 0; color: var(--dm-forest); font-size: clamp(1.55rem,3vw,2.65rem); font-weight: 750; letter-spacing: -.03em; line-height: 1.25; margin: 1.4rem 0 2rem; max-width: 900px; padding: 0; }
.dm-profile-contact { align-items: center; background: #e5e1d7; border-radius: 24px; display: flex; gap: 2rem; justify-content: space-between; margin-top: clamp(3rem,7vw,7rem); padding: clamp(1.5rem,5vw,3.5rem); }
.dm-profile-contact h2 { font-size: clamp(1.8rem,4vw,3.2rem); }
.dm-profile-contact p { color: var(--dm-muted); margin-bottom: 0; }
.dm-profile-contact > a { flex: 0 0 auto; }

/* 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-card, .dm-project-card, body.blog .content-excerpt { transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.dm-card:hover, .dm-project-card:hover, body.blog .content-excerpt:hover { border-color: rgba(22,63,49,.3); box-shadow: 0 22px 55px rgba(17,46,35,.12); transform: translateY(-3px); }
.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: 104px; padding: 1.3rem 1.1rem; }
  #header-content { display: none; }
  #mainnav { max-width: 100%; overflow-x: auto; padding: 0; scrollbar-width: none; }
  #mainnav::-webkit-scrollbar { display: none; }
  #mainnav-menu { flex-direction: row !important; flex-wrap: nowrap; gap: 0; min-width: max-content; width: max-content; }
  #mainnav-menu li { flex: 0 0 auto; width: auto !important; }
  #mainnav-menu a { align-items: center; display: flex; min-height: 48px; padding: .75rem 1rem; white-space: nowrap; }
  #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; }
  .dm-profile-hero, .dm-profile-story, .dm-profile-grid { grid-template-columns: 1fr; }
  .dm-profile-hero { border-radius: 18px; padding: 2rem 1.3rem; }
  .dm-profile-mark { justify-self: start; max-width: 130px; order: -1; }
  .dm-profile-grid article { min-height: 230px; }
  .dm-profile-contact { align-items: flex-start; flex-direction: column; }
  .dm-button, .dm-archive-note nav a, body.blog .content-excerpt .more-link { align-items: center; display: inline-flex; min-height: 44px; }
  .dm-card:hover, .dm-project-card:hover, body.blog .content-excerpt:hover { transform: none; }
}

@media (max-width: 782px) {
  .admin-bar #navi-wrap { top: 46px; }
}
