/* ==========================================================================
   Darwesh Group — Official Digital Identity (DG-0001)
   Static identity endpoint. HTML + CSS only. No JavaScript, no dependencies.
   ========================================================================== */

:root {
  /* Ground */
  --page:        #F7F4EE;   /* warm ivory        */
  --page-foot:   #F1ECE2;
  --sheet:       #FDFCF9;
  --tile:        #F7F4ED;

  /* Rules */
  --hairline:    #E6E1D6;   /* platinum          */
  --hairline-up: #D8D2C5;

  /* Ink */
  --ink:         #14161A;   /* obsidian          */
  --ink-2:       #4E545B;   /* graphite          */
  --ink-3:       #8A9097;

  /* Accents — used sparingly */
  --gold:        #9B7B41;   /* champagne         */
  --gold-line:   rgba(155, 123, 65, .34);
  --green:       #1D5B44;   /* status            */

  --shadow:
    0 1px 1px rgba(20, 22, 26, .03),
    0 14px 34px -20px rgba(20, 22, 26, .22),
    0 44px 86px -64px rgba(20, 22, 26, .34);

  --seal-ring:   0 0 0 1px var(--hairline-up),
                 0 8px 20px -12px rgba(20, 22, 26, .40);

  --radius:      20px;
  --radius-sm:   12px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page:        #0D0F11;
    --page-foot:   #121519;
    --sheet:       #16191D;
    --tile:        #1C2024;

    --hairline:    #262A2F;
    --hairline-up: #343A41;

    --ink:         #EFECE5;
    --ink-2:       #A9AFB5;
    --ink-3:       #787F86;

    --gold:        #C6A469;
    --gold-line:   rgba(198, 164, 105, .30);
    --green:       #4F9E7F;

    --shadow:
      0 1px 1px rgba(0, 0, 0, .40),
      0 16px 36px -22px rgba(0, 0, 0, .70),
      0 50px 90px -60px rgba(0, 0, 0, .80);

    --seal-ring:   0 0 0 1px rgba(255, 255, 255, .10),
                   0 10px 24px -14px rgba(0, 0, 0, .75);
  }
}

/* ---------------------------------------------------------------- reset -- */

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

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

body {
  margin: 0;
  padding: clamp(28px, 7vh, 72px) 20px
           calc(clamp(28px, 7vh, 72px) + env(safe-area-inset-bottom));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--page);
  background-image: linear-gradient(180deg, var(--page) 0%, var(--page-foot) 100%);
  background-attachment: fixed;

  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@supports (min-height: 100svh) { body { min-height: 100svh; } }

h1, p, dl, dd, dt { margin: 0; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 5px;
}

/* ---------------------------------------------------------------- shell -- */

.identity {
  width: 100%;
  max-width: 396px;
}

/* The sheet: one official document, not a stack of cards. Sections are
   divided by hairlines rather than gaps, which is what keeps it reading
   as a record instead of a dashboard. */
.sheet {
  position: relative;
  overflow: hidden;
  background: var(--sheet);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* A single champagne filament across the head of the document. */
.sheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--gold-line) 20%,
    var(--gold) 50%,
    var(--gold-line) 80%,
    transparent 100%);
  opacity: .5;
}

.sheet > * { padding: 22px 22px; }
.sheet > * + * { border-top: 1px solid var(--hairline); }

/* Shared micro-label for every section. */
.eyebrow {
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- crest -- */

.crest {
  padding-top: 34px;
  padding-bottom: 26px;
  text-align: center;
}

/* The artwork sits on an opaque white ground, so it is framed as a seal.
   That reads as deliberate in both themes instead of as a stray tile. */
.crest__seal {
  display: block;
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  background: #FFF;
  border-radius: 15px;
  box-shadow: var(--seal-ring);
  object-fit: contain;
}

.crest__name {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: .2em;
  line-height: 1.25;
  text-transform: uppercase;
  text-indent: .2em;        /* optical centring against the tracking */
  color: var(--ink);
}

.crest__kind {
  margin-top: 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.status {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent);
}

/* ------------------------------------------------------------- registry -- */

.registry {
  padding-top: 24px;
  padding-bottom: 24px;
  text-align: center;
}

.registry__id {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: clamp(1.75rem, 8.5vw, 2.125rem);
  font-weight: 500;
  letter-spacing: .17em;
  text-indent: .17em;
  line-height: 1.1;
  color: var(--ink);
}

.registry__place {
  margin-top: 13px;
  font-size: .8125rem;
  letter-spacing: .02em;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- facts -- */

.facts__list { margin-top: 14px; }

.fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
}

.fact + .fact { border-top: 1px solid var(--hairline); }

.fact dt {
  flex: none;
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.fact dd {
  text-align: right;
  overflow-wrap: anywhere;
}

.fact__value {
  font-size: .875rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 150ms ease;
}

.fact__value--mono {
  font-family: var(--mono);
  letter-spacing: .04em;
}

.fact__value:hover { border-bottom-color: var(--gold-line); }

/* -------------------------------------------------------------- actions -- */

.actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.action {
  min-height: 54px;
  padding: 14px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  background: var(--tile);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--ink);

  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .01em;
  text-decoration: none;

  transition: border-color 150ms ease, background-color 150ms ease,
              transform 110ms ease;
  -webkit-tap-highlight-color: transparent;
}

.action__icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action:hover {
  border-color: var(--hairline-up);
  background: var(--sheet);
}

.action:active { transform: translateY(1px); }

/* ------------------------------------------------------------- channels -- */

/* Quiet by design: no filled tiles here, so the channels sit a clear step
   below the direct actions. Columns are generated from the tile count, so
   restoring a platform needs no CSS change. */
.channels__row {
  margin-top: 12px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

.channel {
  min-height: 56px;
  padding: 11px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;

  color: var(--ink-2);
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-decoration: none;

  transition: color 150ms ease, transform 110ms ease;
  -webkit-tap-highlight-color: transparent;
}

.channel + .channel { border-left: 1px solid var(--hairline); }

.channel__icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.channel:hover { color: var(--ink); }
.channel:active { transform: translateY(1px); }

/* ----------------------------------------------------------------- save -- */

.keep { padding-top: 20px; padding-bottom: 22px; }

.save {
  width: 100%;
  min-height: 54px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  color: var(--sheet);

  font-size: .9375rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-decoration: none;

  transition: opacity 150ms ease, transform 110ms ease;
  -webkit-tap-highlight-color: transparent;
}

.save__icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.save:hover { opacity: .88; }
.save:active { transform: translateY(1px); }

/* ------------------------------------------------------------- colophon -- */

.colophon {
  margin-top: 22px;
  text-align: center;
}

.colophon__stamp {
  font-family: var(--mono);
  font-size: .625rem;
  letter-spacing: .14em;
  color: var(--ink-3);
}

/* ------------------------------------------------------------ viewports -- */

/* 360 class devices: tighten the gutters, never the hierarchy. */
@media (max-width: 374px) {
  body { padding-left: 16px; padding-right: 16px; }

  .sheet > * { padding-left: 18px; padding-right: 18px; }

  .crest__seal { width: 56px; height: 56px; border-radius: 14px; }
  .crest__name { font-size: 1.0625rem; letter-spacing: .17em; text-indent: .17em; }

  .fact { gap: 10px; }
  .fact__value { font-size: .8125rem; }

  .action { min-height: 50px; gap: 7px; padding: 13px 6px; font-size: .8125rem; }
  .action__icon { width: 15px; height: 15px; }

  .channel { font-size: .5625rem; padding: 11px 2px; }
}

/* Desktop: the record stays a document. It does not become a panel. */
@media (min-width: 768px) {
  .identity { max-width: 416px; }
  .sheet > * { padding-left: 26px; padding-right: 26px; }
  .crest { padding-top: 38px; }
}

/* -------------------------------------------------------- reduced motion -- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .action:active, .save:active, .channel:active { transform: none; }
}

/* --------------------------------------------------------- high contrast -- */

@media (prefers-contrast: more) {
  :root {
    --hairline:  var(--ink-3);
    --ink-2:     var(--ink);
    --ink-3:     var(--ink-2);
  }
}
