@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;650;700;800&family=Instrument+Serif:ital@1&display=swap');

:root {
  color-scheme: dark;
  --canvas: #111116;
  --surface: #191920;
  --surface-hover: #24232d;
  --line: #30303b;
  --ink: #f0eef5;
  --muted: #b6b3c3;
  --accent: #cbb5ff;
  --accent-muted: #28223a;
  --accent-line: #504165;
  --action: #d8f878;
  --action-hover: #e6ffa1;
  --on-action: #171b11;
  --focus: #c5acff;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

:root[data-theme='light'] {
  color-scheme: light;
  --canvas: #ece9f2;
  --surface: #e5e0ee;
  --surface-hover: #dcd5ea;
  --line: #c9c1d6;
  --ink: #201a29;
  --muted: #514a60;
  --accent: #5a367e;
  --accent-muted: #ddd3ec;
  --accent-line: #b8a6cf;
  --action: #38501e;
  --action-hover: #465e2a;
  --on-action: #f2f9e8;
  --focus: #6b399f;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
body { line-height: 1.55; }
a { color: inherit; text-underline-offset: .22em; }
button { color: inherit; font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
section[id] { scroll-margin-top: 1.5rem; }
.wrap { width: min(100% - 4rem, 72rem); margin-inline: auto; }
.skip { position: absolute; z-index: 3; left: 1rem; top: 1rem; padding: .65rem 1rem; background: var(--action); color: var(--on-action); transform: translateY(-200%); }
.skip:focus { transform: translateY(0); }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; }
.header-inner { min-height: 4.35rem; }
.brand { display: inline-flex; align-items: center; font-size: 1.48rem; font-weight: 800; letter-spacing: -.065em; text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; gap: .16rem; margin-right: .62rem; transform: skewX(-22deg); }
.brand-mark i { width: .21rem; height: .91rem; border-radius: 1rem; background: var(--action); }
.brand-mark i:nth-child(2) { height: 1.16rem; }
.brand-dot { color: var(--action); }
.header-actions, nav { display: flex; align-items: center; }
.header-actions { gap: clamp(1rem, 4vw, 3rem); }
nav { gap: clamp(.85rem, 3vw, 2rem); }
nav a { padding-block: .6rem; color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 700; }
nav a:hover { color: var(--ink); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.45rem; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); color: var(--ink); font-size: .875rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.theme-toggle:hover { background: var(--surface-hover); border-color: var(--accent-line); }
.theme-icon { width: .98rem; height: 1rem; display: grid; place-items: center; color: var(--accent); }
.theme-icon::before { content: '\263c'; font: 1.22rem/1 system-ui, sans-serif; }
[data-theme='light'] .theme-icon::before { content: '\263e'; }

.hero { overflow: hidden; background: radial-gradient(ellipse at 80% 12%, color-mix(in srgb, var(--accent-muted) 60%, transparent), transparent 60%); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: center; gap: clamp(1.75rem, 5.8vw, 5rem); padding-block: clamp(3.3rem, 6.5vw, 5.45rem); }
.eyebrow { color: var(--accent); font-size: .88rem; font-weight: 700; letter-spacing: .035em; }
h1 { margin-top: .78rem; font-size: clamp(3.35rem, 7.1vw, 6.5rem); font-weight: 800; letter-spacing: -.075em; line-height: .94; }
h1 em { color: var(--accent); font-family: 'Instrument Serif', Georgia, serif; font-size: 1.1em; font-weight: 400; letter-spacing: -.043em; }
.intro { max-width: 28rem; margin-top: 1.15rem; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.17rem); }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.6rem; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 2.9rem; padding: .56rem 1rem; border: 1px solid transparent; border-radius: .5rem; font-size: .94rem; font-weight: 800; text-align: center; text-decoration: none; transition: background-color 160ms, color 160ms, border-color 160ms; }
.primary { color: var(--on-action); background: var(--action); }
.primary:hover { background: var(--action-hover); }
.secondary { border-color: var(--line); color: var(--ink); background: var(--surface); }
.secondary:hover { border-color: var(--accent-line); background: var(--surface-hover); }

.hero-art { position: relative; display: grid; place-items: center; aspect-ratio: 1.32; overflow: hidden; isolation: isolate; border: 1px solid #534269; border-radius: .95rem; background: radial-gradient(ellipse at 68% 6%, #62498c, transparent 64%), linear-gradient(150deg, #251c37, #3e2a59 64%, #2e2346); }
.hero-art::before { position: absolute; z-index: -1; inset: 0; content: ''; background-image: radial-gradient(#d7c6ff70 .7px, transparent .8px); background-size: .75rem .75rem; mask-image: radial-gradient(ellipse at center, black 26%, transparent 82%); }
.orbit { position: absolute; inset: 14% 4%; z-index: -1; border: 1px solid #cfb4fc40; border-radius: 50%; transform: rotate(-30deg); }
.orbit-inner { inset: 25% 10%; }
.art-window { width: 72%; overflow: hidden; border: 1px solid #e4d5ff50; border-radius: .62rem; background: #1b1724; box-shadow: .7rem 1.25rem 2.5rem #100d1fa0; transform: rotate(-7deg); }
.art-bar { display: flex; align-items: center; gap: .35rem; height: clamp(1.35rem, 3vw, 1.85rem); padding-inline: 5%; border-bottom: 1px solid #ffffff24; }
.art-bar span { width: .32rem; height: .32rem; border-radius: 50%; background: #8a7ca2; }
.art-bar b { width: 42%; height: .35rem; margin-left: 10%; border-radius: 2rem; background: #423751; }
.art-grid { display: grid; grid-template-columns: 23% 1fr; aspect-ratio: 1.65; }
.art-side { display: flex; flex-direction: column; gap: .48rem; padding: 25% 15%; background: #241e30; }
.art-side i { height: .23rem; border-radius: 1rem; background: #766786; }
.art-side i:first-child { background: #d8f878; }
.art-main { display: grid; grid-template-rows: auto .85fr 1.5fr; gap: 10%; min-height: 0; padding: 7%; }
.art-title { width: 52%; height: .42rem; border-radius: 1rem; background: #e1d4f5; }
.art-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7%; }
.art-tiles i { border: 1px solid #ffffff12; border-radius: .25rem; background: #3a2e50; }
.art-tiles i:first-child { background: #b3a0db; }
.art-chart { display: flex; align-items: end; justify-content: space-around; gap: 5%; padding: 7% 8% 4%; border: 1px solid #ffffff12; border-radius: .25rem; background: #2d243e; }
.art-chart i { flex: 1; height: 38%; border-radius: .2rem .2rem 0 0; background: #9c7bd7; }
.art-chart i:nth-child(2n) { height: 63%; }
.art-chart i:nth-child(3n) { height: 51%; }
.art-chart i:last-child { height: 92%; background: #d8f878; }
.art-cursor { position: absolute; left: 75%; top: 66%; width: 8%; aspect-ratio: .8; background: #d8f878; clip-path: polygon(7% 0, 96% 62%, 56% 66%, 43% 100%); transform: rotate(9deg); }

.work { padding-top: .65rem; }
.services { padding-top: clamp(2.8rem, 6vw, 4.75rem); }
.section-bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin-bottom: 1.05rem; }
.section-bar h2 { font-size: clamp(1.65rem, 3vw, 2.05rem); letter-spacing: -.05em; line-height: 1.1; }
.section-bar > span { color: var(--muted); font-size: .88rem; font-weight: 600; }
.project { display: grid; grid-template-columns: .86fr 1.14fr; border: 1px solid var(--line); border-radius: .9rem; overflow: hidden; background: var(--surface); }
.project-copy { align-self: center; padding: clamp(1.35rem, 4vw, 3rem); }
.project h3 { margin-bottom: .5rem; font-size: clamp(2.45rem, 5vw, 3.7rem); font-weight: 800; letter-spacing: -.07em; line-height: 1; }
.project p { color: var(--muted); max-width: 29rem; }
.project .project-summary { margin-bottom: .52rem; color: var(--ink); font-weight: 700; }
.project-link { margin-top: 1.25rem; color: var(--accent); background: var(--accent-muted); border-color: var(--accent-line); }
.project-link:hover { background: var(--surface-hover); }

.project-visual { display: grid; place-items: center; overflow: hidden; min-height: 19rem; padding: 2rem 1.4rem; background: radial-gradient(ellipse at 70% 8%, #3e6453, transparent 71%), #18332e; }
.library-window { width: min(100%, 27rem); overflow: hidden; border: 1px solid #668579; border-radius: .6rem; background: #16241f; color: #ecf0e6; box-shadow: 0 1rem 2.4rem #091b1690; transform: rotate(-3deg); }
.library-bar { display: flex; align-items: center; gap: .4rem; padding: .58rem 6%; border-bottom: 1px solid #35473f; font-size: .82rem; }
.leaf { width: .65rem; height: .85rem; background: #acd6a3; border-radius: 80% 0 80% 0; transform: rotate(13deg); }
.library-avatar { margin-left: auto; width: 1.3rem; height: 1.3rem; display: grid; place-items: center; border-radius: 50%; background: #3d5849; font-size: .65rem; font-weight: 800; }
.library-body { padding: 5% 6% 6%; }
.library-title { font-family: Georgia, serif; font-size: clamp(1.55rem, 4vw, 2.2rem); line-height: 1.15; }
.library-search { margin-block: .65rem; padding: .3rem .5rem; border: 1px solid #4b6254; border-radius: .27rem; background: #22362c; color: #c3d4c7; font-size: .67rem; }
.book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5%; }
.book { position: relative; display: grid; align-content: space-between; min-width: 0; aspect-ratio: .76; padding: 10%; border: 1px solid #ffffff24; border-radius: .24rem; overflow: hidden; font: 600 clamp(.53rem, 1.2vw, .77rem)/1.1 Georgia, serif; box-shadow: inset .2rem 0 #0002; }
.book i { width: 61%; justify-self: center; aspect-ratio: 1; margin-bottom: 10%; border: 1px solid currentColor; border-radius: 50% 50% 5% 50%; transform: rotate(30deg); opacity: .65; }
.book-violet { color: #ede2fa; background: #554375; }
.book-orange { color: #352016; background: #dea179; }
.book-green { color: #edf2d7; background: #47674e; }
.book-pink { color: #542b44; background: #eec4d9; }

.services { padding-bottom: clamp(2.65rem, 6vw, 4.5rem); }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .72rem; }
.service-grid article { padding: clamp(1.15rem, 2.5vw, 1.55rem); border: 1px solid var(--line); border-radius: .72rem; background: var(--surface); }
.service-grid h3 { margin-bottom: .3rem; font-size: 1.1rem; letter-spacing: -.027em; }
.service-grid p { color: var(--muted); }
.service-icon { display: grid; place-items: center; width: 2.15rem; height: 2.15rem; margin-bottom: .85rem; border: 1px solid var(--accent-line); border-radius: .42rem; background: var(--accent-muted); color: var(--accent); }
.service-icon::before { content: ''; display: block; box-sizing: border-box; }
.icon-dashboard::before { width: .94rem; height: .77rem; border: 1px solid currentColor; border-radius: .13rem; background: linear-gradient(to right, transparent 33%, currentColor 33% 42%, transparent 42%), linear-gradient(transparent 40%, currentColor 40% 54%, transparent 54%); }
.icon-portal::before { width: .72rem; height: .87rem; border: 1px solid currentColor; border-radius: .13rem .13rem 0 0; background: radial-gradient(circle at 72% 53%, currentColor 1px, transparent 1.2px); }
.icon-app::before { width: .94rem; height: .77rem; border: 1px solid currentColor; border-radius: .13rem; background: linear-gradient(transparent 27%, currentColor 27% 39%, transparent 39%); }

.contact-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.35rem 2.5rem; padding: clamp(1.5rem, 5vw, 3.75rem); border: 1px solid var(--accent-line); border-radius: .9rem; background: radial-gradient(ellipse at 88% 5%, var(--accent-muted), transparent 72%), var(--surface); }
.contact h2 { font-size: clamp(2rem, 4.7vw, 3.5rem); line-height: 1.02; letter-spacing: -.065em; }
.contact p { color: var(--muted); margin-top: .65rem; max-width: 34rem; }
.contact-actions { display: grid; justify-items: start; gap: .55rem; }
.email { font-size: .9rem; color: var(--muted); }
.email:hover { color: var(--ink); }
.site-footer { margin-top: clamp(2.2rem, 5vw, 3.2rem); color: var(--muted); border-top: 1px solid var(--line); }
.footer-inner { min-height: 4rem; font-size: .875rem; }
.footer-inner span { color: var(--ink); font-weight: 700; }

@media (max-width: 56rem) {
  .hero-inner { gap: 2rem; }
  h1 { font-size: clamp(3.1rem, 8.3vw, 4.8rem); }
  .project-visual { min-height: 15rem; }
}

@media (max-width: 42rem) {
  .wrap { width: calc(100% - 2rem); }
  .header-inner { min-height: 4rem; gap: .5rem; }
  .header-actions { gap: .75rem; }
  nav { gap: .72rem; }
  .hero-inner, .project, .contact-inner { grid-template-columns: 1fr; }
  .hero-inner { gap: 2rem; }
  .hero-art { aspect-ratio: 1.55; }
  .art-window { width: 67%; }
  .work { padding-top: 0; }
  .project-visual { min-height: 0; }
  .service-grid { grid-template-columns: 1fr; }
}

@media (max-width: 28rem) {
  h1 { font-size: clamp(2.7rem, 13vw, 3.6rem); }
  .brand { font-size: 1.25rem; }
  .brand-mark { margin-right: .4rem; }
  .header-actions, nav { gap: .6rem; }
  .theme-toggle { width: 2.45rem; padding: .3rem; }
  #theme-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; white-space: nowrap; clip-path: inset(50%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
